3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 10; $b = 20; // Normally echo ($a < $b) ? -1 : (($a > $b ) ? 1 : 0) . "\n"; echo "\n"; // Combined comparision echo $a <=> $b; echo "\n"; $a = 80; $b = 60; // Normally echo ($a < $b) ? -1 : (($a > $b ) ? 1 : 0); echo "\n"; // Combined comparision echo $a <=> $b; echo "\n"; $a = 50; $b = 50; // Normally echo ($a < $b) ? -1 : (($a > $b ) ? 1 : 0); echo "\n"; // Combined comparision echo $a <=> $b; echo "\n";
based on R6VYe
Output for 7.0.0 - 7.2.0
-1 -1 1 1 0 0
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected '>' in /in/UCJP6 on line 10
Process exited with code 255.