3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class TT { abstract public static function xd(); } class Test { protected const ASD = 23; private static int $field = 5; public string $foo = 'default value' { get { var_dump(debug_backtrace()); return $this->foo; } set(string $value) { var_dump(debug_backtrace()); } } public static function &getSomeProperty() { return self::$field; } } $a =& Test::getSomeProperty(); if ($a === 5) { $a = 2; } var_dump(Test::getSomeProperty()); // 2 $test = new Test(); $test->foo;
Output for git.master_jit, git.master
int(2) array(1) { [0]=> array(7) { ["file"]=> string(9) "/in/BFo3Z" ["line"]=> int(39) ["function"]=> string(9) "$foo::get" ["class"]=> string(4) "Test" ["object"]=> object(Test)#1 (1) { ["foo"]=> string(13) "default value" } ["type"]=> string(2) "->" ["args"]=> array(0) { } } }

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:
48.89 ms | 724 KiB | 4 Q