3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myErrorHandler($errno) { var_dump($errno); if ( E_RECOVERABLE_ERROR===$errno ) { echo "'catched' catchable fatal error\n"; return true; } return false; } set_exception_handler('myErrorHandler'); class ClassA { public function method_a (ClassB $b) {} } class ClassWrong{} $a = new ClassA; $a->method_a(new ClassWrong); echo 'done.';
Output for git.master, git.master_jit, rfc.property-hooks
object(TypeError)#3 (7) { ["message":protected]=> string(109) "ClassA::method_a(): Argument #1 ($b) must be of type ClassB, ClassWrong given, called in /in/0WCuK on line 20" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/0WCuK" ["line":protected]=> int(14) ["trace":"Error":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/0WCuK" ["line"]=> int(20) ["function"]=> string(8) "method_a" ["class"]=> string(6) "ClassA" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> object(ClassWrong)#2 (0) { } } } } ["previous":"Error":private]=> NULL }

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:
53.72 ms | 403 KiB | 8 Q