3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { static public $p = 1; static function foo() {} function __toString() : string { return 'foo'; } } $name = []; // try with different type : bool, int, float, object.. try { echo X::$name; } catch (Error $e) { print $e->getMessage(); } $name = []; try { echo X::${$name}(); } catch (Error $e) { print $e->getMessage(); } ?>
Output for git.master, git.master_jit
Access to undeclared static property X::$name Warning: Array to string conversion in /in/aKlmO on line 22 Warning: Undefined variable $Array in /in/aKlmO on line 22 Method name must be a string

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:
47.4 ms | 866 KiB | 4 Q