3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private function myPrivate() { return true; } } class Bar extends Foo {} $obj = new Bar; $reflMethod = new \ReflectionMethod($obj, 'myPrivate'); $reflMethod->setAccessible(true); $return = $reflMethod->invoke($obj); var_dump($return);
Output for git.master, rfc.property-hooks
Fatal error: Uncaught ReflectionException: Method Bar::myPrivate() does not exist in /in/8YcIk:13 Stack trace: #0 /in/8YcIk(13): ReflectionMethod->__construct(Object(Bar), 'myPrivate') #1 {main} thrown in /in/8YcIk on line 13
Process exited with code 255.
Output for git.master_jit
bool(true)

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:
51.05 ms | 406 KiB | 5 Q