3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected static $_instance; protected function __construct() {} public static function getInstance() { if (self::$_instance === null) { self::$_instance = new static(); } return self::$_instance; } } class B extends A { public function hi() { echo 'HI'; } } echo get_class(B::getInstance()); B::hi();
Output for git.master, git.master_jit, rfc.property-hooks
B Fatal error: Uncaught Error: Non-static method B::hi() cannot be called statically in /in/5UQE7:26 Stack trace: #0 {main} thrown in /in/5UQE7 on line 26
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:
55.49 ms | 401 KiB | 8 Q