3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compare_behaviour($arg1, $arg2) { static $test = 0; ++$test; $res1 = ($arg1 ?: $arg2); $res2 = ($arg1 or $arg2); echo "$test\n========\n"; if( $res1 === $res2 ){ var_dump($arg1, $arg2, $res1, $res2); } } compare_behaviour(false, true); compare_behaviour(0, 1); compare_behaviour(0, 0); compare_behaviour(NULL, []);

preferences:
41.26 ms | 402 KiB | 5 Q