3v4l.org

run code in 300+ PHP versions simultaneously
<?php function magic($p, $q) { if ($q == 0) { var_dump('================================'); var_dump('$p: ' . $p); var_dump('$q: ' . $q); var_dump('================================'); return $p; } else { var_dump('================================'); var_dump('$p: ' . $p); var_dump('$q: ' . $q); var_dump('$p % $q: ' . $p % $q); var_dump('================================'); __halt_compiler(); return magic($q, $p % $q); } } var_dump(magic(1024, 1000));
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.35
Fatal error: __HALT_COMPILER() can only be used from the outermost scope in /in/eWsQc on line 15
Process exited with code 255.
Output for 5.0.0 - 5.0.5
string(32) "================================" string(8) "$p: 1024" string(8) "$q: 1000" string(11) "$p % $q: 24" string(32) "================================" Fatal error: Call to undefined function __halt_compiler() in /in/eWsQc on line 15
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(32) "================================" string(8) "$p: 1024" string(8) "$q: 1000" string(11) "$p % $q: 24" string(32) "================================" Fatal error: Call to undefined function: __halt_compiler() in /in/eWsQc on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
string(32) "================================" string(8) "$p: 1024" string(8) "$q: 1000" string(11) "$p % $q: 24" string(32) "================================" Fatal error: Call to undefined function: __halt_compiler() in /in/eWsQc on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(32) "================================" string(8) "$p: 1024" string(8) "$q: 1000" string(11) "$p % $q: 24" string(32) "================================" Fatal error: Call to undefined function: __halt_compiler() in /in/eWsQc on line 15

preferences:
198.94 ms | 1387 KiB | 125 Q