<?php
$left = 4;
$right = '4';
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
it("should compare simple values as equals", $left == $right);
it("should NOT compare ints and strings as equals if using identity", $left === $right);
it("should compare by identity if you typecast a string to an int", $left === (int) $right);
it("should compare by identity if you typecast an int to a string", (string) $left === $right);
✔︎ It should compare simple values as equals
✘ It should NOT compare ints and strings as equals if using identity
✔︎ It should compare by identity if you typecast a string to an int
✔︎ It should compare by identity if you typecast an int to a string