3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj { function __tostring() { $GLOBALS['a'] = 'hi'; } } $a = [0, new obj, 2]; $b = ["Nula", "Jedna", "Dva"]; var_dump($a); str_replace($a, $b, "1"); var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> int(0) [1]=> object(obj)#1 (0) { } [2]=> int(2) } Fatal error: Uncaught TypeError: obj::__tostring(): Return value must be of type string, none returned in /in/W51BS:6 Stack trace: #0 [internal function]: obj->__tostring() #1 /in/W51BS(13): str_replace(Array, Array, '1') #2 {main} thrown in /in/W51BS 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:
55.44 ms | 401 KiB | 8 Q