3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for git.master, git.master_jit, rfc.property-hooks
✔︎ 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

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.07 ms | 402 KiB | 8 Q