Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:52:47+00:00 2026-06-07T19:52:47+00:00

i recently had to do a test for a job, and i got feed

  • 0

i recently had to do a “test” for a job, and i got feed back saying that this statement was incorrect:

$images = $flickr->get_images(5, !empty($_GET['pg']) ? $_GET['pg'] : 1);

The “supposed” error was generated via the ternary operator on the first time the page was loaded, as there was no “?pg=1” (or whatever) passed via the query string.

The feed back said i should have used isset instead. I have looked at various posts both here (question 1960509) and blogs, but cannot find any definitive answer.

Is this really an error? How can i replicate this issue? do i need to put on E_STRICT or something in my php.ini file? Or might this be due to an older version of php?

Note: please don’t tell me about how i should validate things.. i know this… it was a test to just see if i could use the flickr api calls.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:52:48+00:00Added an answer on June 7, 2026 at 7:52 pm

    This is perfectly fine. empty is not an actual function, it’s a language construct. It does not issue a warning if a variable is not set (in that case the variable is considered empty, thus the ‘function’ returns TRUE just as you want), and additionally it checks for empty or zero values.

    You could see empty as a normal isset check with an additional loose comparison to FALSE:

    empty($var) === (!isset($var) || $var == FALSE)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently had this problem on a test: given a set of points m
I recently had a techical test for a job interview where I did a
I recently had this question in an interview to write test cases to test
I recently had a 30 min test for a job application using only Javascript
I recently had a similar thread about this, but now I need to animate
I recently had this issue with a client. The code read: ini_set( sendmail_from, noreply@<current-domain>.com
We have recently had to do some work with an OpenEdge database that a
recently I had to write a little script that parsed VMs in XenServer and
Recently, we made some changes to some SQL Server views that had the potential
Recently I had to fix a bug that was reported from the field. While

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.