3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __destruct() { static $i = 0; $i++; throw new Exception('Foo::__destruct() ' . $i); } } try { var_dump(new Foo() + new Foo()); } catch (Exception $e) { var_dump($e); }
Output for rfc.property-hooks
object(Exception)#1 (7) { ["message":protected]=> string(19) "Foo::__destruct() 2" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/um5TH" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/um5TH" ["line"]=> int(12) ["function"]=> string(10) "__destruct" ["class"]=> string(3) "Foo" ["type"]=> string(2) "->" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> object(Exception)#4 (7) { ["message":protected]=> string(19) "Foo::__destruct() 1" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/um5TH" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/um5TH" ["line"]=> int(12) ["function"]=> string(10) "__destruct" ["class"]=> string(3) "Foo" ["type"]=> string(2) "->" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> object(TypeError)#3 (7) { ["message":protected]=> string(36) "Unsupported operand types: Foo + Foo" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/um5TH" ["line":protected]=> int(12) ["trace":"Error":private]=> array(0) { } ["previous":"Error":private]=> NULL } } }
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.

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:
41.67 ms | 1353 KiB | 4 Q