note 58849 deleted from function.compact by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 12:18:50 +0000 |
| Subject: | note 58849 deleted from function.compact by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197174@lists.php.net to get a copy of this message | ||
Note Submitter: mijllirg at wearethedotin dot com
----
You might could think of it as ${$var}. So, if you variable is not accessible with the ${$var} it
will not working with this function. Examples being inside of function or class where you variable
is not present.
<?php
$foo = 'bar';
function blah()
{
// this will no work since the $foo is not in scope
$somthin = compact('foo'); // you get empty array
}
?>
PS: Sorry for my poor english...