Vag Posted September 24, 2015 Posted September 24, 2015 $hi = null; if($hi =!null) { $hi = null; } else if ($hi =!null) { $hi = !null; } if ($hi = null) { $hi = !null; } else if { $hi = !null; }
Lemons Posted September 24, 2015 Posted September 24, 2015 (edited) $hi = null; if($hi =!null) { // $hi = !null always returns true, $hi != null checks against nulls (or false/""/etc) $hi = null; // Set $hi to "null" } if ($hi = null) { // $hi = null always returns true, $hi == null checks for nulls (or false/""/etc) $hi = !null; // Set $hi to "true" } The rest is dead code, and welcome to Type Juggling! Edit: Sorry, I lied, tricky syntax Fixed now Edited September 24, 2015 by dudeami