3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function a() { } } class B { private function a() { } } $method = new \ReflectionMethod('A', 'a'); var_dump($method->getClosure(new A())); var_dump($method->getClosure(new B()));
Output for git.master, git.master_jit, rfc.property-hooks
object(Closure)#3 (2) { ["function"]=> string(4) "A::a" ["this"]=> object(A)#2 (0) { } } Fatal error: Uncaught ReflectionException: Given object is not an instance of the class this method was declared in in /in/jUs7I:20 Stack trace: #0 /in/jUs7I(20): ReflectionMethod->getClosure(Object(B)) #1 {main} thrown in /in/jUs7I on line 20
Process exited with code 255.

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:
52.74 ms | 402 KiB | 8 Q