3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* class A { public function __set($name, $value) { echo func_get_arg(0); $name = "xxx"; echo func_get_arg(0); } public function test($name) { echo func_get_arg(0); $name = "xxx"; echo func_get_arg(0); } } $a = new A(); $a->test('test'); $a->test = 5; function byVal($arg) { echo 'As passed : ', var_export(func_get_arg(0)), PHP_EOL; $arg = 'baz'; echo 'After change : ', var_export(func_get_arg(0)), PHP_EOL; } function byRef(&$arg) { echo 'As passed : ', var_export(func_get_arg(0)), PHP_EOL; $arg = 'baz'; echo 'After change : ', var_export(func_get_arg(0)), PHP_EOL; } $arg = 'bar'; byVal($arg); byRef($arg); */ function set($name, $value) { $a = array(); echo $name; // property setter support $originalName = $name; $name[0] = $name[0] & "\xDF"; // case-sensitive checking, capitalize first character echo $name; // protected attribute support $properties = $this->listObjectProperties(); if (isset($a[$name = $originalName])) { echo $name; } echo $name; } set('user', 'test');
Output for git.master, git.master_jit, rfc.property-hooks
userUser Fatal error: Uncaught Error: Using $this when not in object context in /in/K1OX2:54 Stack trace: #0 /in/K1OX2(61): set('User', 'test') #1 {main} thrown in /in/K1OX2 on line 54
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:
45.7 ms | 401 KiB | 8 Q