note 104216 deleted from language.types.null by cmb
| From: | cmb@php.net | Date: | Fri, 15 May 2015 19:06:34 +0000 |
| Subject: | note 104216 deleted from language.types.null by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202540@lists.php.net to get a copy of this message | ||
Note Submitter: ryan at trezshard dot com
----
This simple shorthand seems to work for setting new variables to NULL:
<?php
$Var;
?>
The above code will set $Var to NULL
UPDATE: After further testing it appears the code only works in the global scope and does not work
inside functions.
<?php
function Example(){
$Var;
var_dump($Var);
}
?>
Would not work as expected.