PHP 7.2.0 Beta 1 Released

Voting

Please answer this simple SPAM challenge: max(one, four)?
(Example: nine)

The Note You're Voting On

dnhuff at acm dot org
9 years ago
This is discussed before (below) but bears repeating:

$a = null; ($a =& null; does not parse) is NOT the same as unset($a);

$a = null; replaces the value at the destination of $a with the null value;

If you chose to use a convention like $NULL = NULL;

THEN, you could say $a =& $NULL to break any previous reference assignment to $a (setting it of course to $NULL), which could still get you into trouble if you forgot and then said $a = '5'. Now $NULL would be '5'.

Moral: use unset when it is called for.

<< Back to user notes page

To Top