php > $a = 2/0;
PHP Warning: Division by zero in php shell code on line 1
php > var_dump( $a );
bool(false)
PHP Warning: Division by zero in php shell code on line 1
php > var_dump( $a );
bool(false)
Moments of joy with PHP - (and other languages (but mostly PHP :D))
<?
$a = array(1,2,3);
$b = array(2,3);
var_dump($a==$b); // false
var_dump($a===$b); // false
array_shift($a); // $a = (2,3)
var_dump($a==$b); // true
var_dump($a===$b); // true (!)
$x = new StdClass();
$y = new StdClass();
var_dump($x == $y); // true
var_dump($x === $y); // false
class X {};
$p = new X();
$q = new X();
var_dump($p == $q); // true
var_dump($p === $q); // false
$r = array();
var_dump($p == $r); // false
var_dump($p === $r); // false
var_dump("X" == X); // true
var_dump("X" === X); // true