3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RootClass { public static function getStaticName() { echo 'get_called_class(): ' . get_called_class(). "\n"; echo 'static::$class: ' . static::$class . "\n"; } public function getName() { static::getStaticName(); } } class SubClass extends RootClass {} $instance = new SubClass(); $instance::getStaticName();
Output for git.master, git.master_jit, rfc.property-hooks
get_called_class(): SubClass Fatal error: Uncaught Error: Access to undeclared static property SubClass::$class in /in/c24ea:6 Stack trace: #0 /in/c24ea(16): RootClass::getStaticName() #1 {main} thrown in /in/c24ea on line 6
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:
63.16 ms | 401 KiB | 8 Q