3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = 0; $y = 1; if ($x <=> $y) { echo "TRUE\n\n"; } else { echo "FALSE\n\n"; } $x = "Carrot"; $y = "Carrot Juice"; echo $x <=> $y; if ($x <=> $y) { echo "TRUE\n\n"; } else { echo "FALSE\n\n"; } $x = "Carrot Juice"; $y = "Carrot"; echo $x <=> $y; if ($x <=> $y) { echo "TRUE\n\n"; } else { echo "FALSE\n\n"; } $x = array("carrot", "juice"); $y = "carrot juice"; echo $x <=> $y; if ($x <=> $y) { echo "TRUE\n\n"; } else { echo "FALSE\n\n"; }
based on EEhis
Output for 7.0.0 - 7.2.0
TRUE -1TRUE 1TRUE 1TRUE
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected '>' in /in/4VMch on line 5
Process exited with code 255.