3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Provoke extends RecursiveIteratorIterator { public function __construct() { $this->foo(); } } $test = new Provoke();
Output for 5.2.6 - 5.6.28, 7.0.0 - 7.1.0
Fatal error: Provoke::__construct(): The Provoke instance wasn't initialized properly in /in/uS04U on line 6
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: -1 Fatal error: Uncaught exception 'Exception' with message 'inner iterator must implement RecursiveIterator' in /in/uS04U:6 Stack trace: #0 /in/uS04U(6): RecursiveIteratorIterator->__call() #1 /in/uS04U(10): Provoke->__construct() #2 {main}
Process exited with code 255.
Output for 5.1.0 - 5.2.5

Process exited with code 139.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined method Provoke::foo() in /in/uS04U on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uS04U 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_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uS04U on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/uS04U on line 5
Process exited with code 255.