3v4l.org

run code in 200+ PHP versions simultaneously
<?php class A { private static function testprivate() { return 1; } public static function test() { return function() { return self::testprivate(); }; } } class B extends A { } $fn = B::test(); echo $fn();

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
1
Output for branch php-master+opcache
1
Output for branch php-master+jit
1
Output for Typed properties v2
1
Output for Arrow functions
1
Output for Object typehint
1
Output for Array change keys
1
Output for Lexical anon
Fatal error: Call to private method A::testprivate() from context 'B' in /in/WSIu7 on line 9
Process exited with code 255.

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