3v4l.org

run code in 300+ PHP versions simultaneously
<?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 />";
Output for git.master, git.master_jit, rfc.property-hooks
start Exception Handler is Error No Error shutdown

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
65.29 ms | 401 KiB | 8 Q