3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $expected = 1; $actual = true; $code = 'return $expected == $actual;'; var_export(assert($code)); echo "\n"; var_export(eval("return $code;"));
Output for 7.1.0
Fatal error: Uncaught ParseError: syntax error, unexpected 'return' (T_RETURN), expecting ';' in /in/tNk36(5) : assert code:1 Stack trace: #0 /in/tNk36(5): assert('return $expecte...', 'assert($code)') #1 {main} Next Error: Failure evaluating code: assert($code):"return $expected == $actual;" in /in/tNk36:5 Stack trace: #0 /in/tNk36(5): assert('return $expecte...', 'assert($code)') #1 {main} thrown in /in/tNk36 on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Parse error: syntax error, unexpected 'return' (T_RETURN), expecting ';' in /in/tNk36(5) : assert code on line 1 Catchable fatal error: assert(): Failure evaluating code: assert($code):"return $expected == $actual;" in /in/tNk36 on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected 'return' (T_RETURN) in /in/tNk36(5) : assert code on line 1 Catchable fatal error: assert(): Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.
Output for 5.2.0 - 5.3.29
Parse error: syntax error, unexpected T_RETURN in /in/tNk36(5) : assert code on line 1 Catchable fatal error: assert(): Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Parse error: syntax error, unexpected T_RETURN in /in/tNk36(5) : assert code on line 1 Fatal error: assert(): Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_RETURN in /in/tNk36(5) : assert code on line 1 Fatal error: assert(): Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_RETURN in /in/tNk36(5) : assert code on line 1 Fatal error: Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_RETURN in /in/tNk36(5) : assert code on line 1 Fatal error: Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tNk36(5) : assert code on line 1 Fatal error: Failure evaluating code: return $expected == $actual; in /in/tNk36 on line 5
Process exited with code 255.