Jump to content

if I return a Null is the variable empty or not set?


onedumbcoder

Recommended Posts

i have a function that returns either an array or nothing.

 

so lets say it returns an array

 

$list = getList();

 

then would $list no longer be empty?

!empty($list) == true 

 

or would it still be empty and would I need to do this instead

 

!empty($list[0]) == true 

 

 

what if it does not return anything:

 

getList(){ return; }

 

would list not be set so that this would be false:

 

isset($list)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.