3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "start\n"; register_shutdown_function(function() { $err = error_get_last(); if ($err) { echo "Yes Error\n"; echo "Error is: ".print_r($err, True); } else { echo "No Error\n"; } echo "shutdown\n"; }); set_exception_handler(function($ex) { if ($ex instanceof Error) { echo "Exception Handler is Error\n"; return Null; } echo "Exception Handler\n"; die(); }); set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) { echo "Error Handler: ".$errstr."\n"; echo "Error Type: ".$errno."\n"; die(); #throw new ErrorException("raising errorexception", 0, $errno, $errfile, $errline); }); class Foo { public function __construct() { $this->foo = 5; } public function foo() { if ($this->foo === 5) { echo "Called Foo.foo()\n"; } } public function other() { echo "Called Foo.other()\n"; } public function bad() { $not.there(); } } $foo = new Foo(); #$foo.bar(); #$fig.bar(); $foo.bad(); #$bar.foo(); #Foo::foo(); #Foo::other(); #$x = $y + 5; #$file=fopen("welcome.txt","r"); #echo $foo . "appending<br />"; #$t = I_AM_NOT_DEFINED; # #trigger_error("Triggered Error", E_USER_ERROR); #password_hash("swordfish", PASSWORD_BCRYPT, array("salt"=>"sjienvidndiwnsosvknsfoiwnlnvsoi")); echo "Continuing execution<br />";
based on 9F68U
Output for 7.0.0 - 7.3.0beta1
start Exception Handler is Error No Error shutdown
Output for 5.5.0 - 5.6.21
start Fatal error: Call to undefined function bad() in /in/v0CAR on line 57 Yes Error Error is: Array ( [type] => 1 [message] => Call to undefined function bad() [file] => /in/v0CAR [line] => 57 ) shutdown
Process exited with code 255.