3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar1 = 'a'; private $bar2 = 'b'; public function Update($updateInfo) { $this->{$updateInfo['property']} = $updateInfo[$updateInfo['property']]; } } $objFoo = new Foo(); $updateInfo['bar1'] = 'newVal'; $updateInfo['property'] = 'bar1'; $objFoo->Update($updateInfo); var_dump($objFoo);
Output for git.master, git.master_jit, rfc.property-hooks
object(Foo)#1 (2) { ["bar1":"Foo":private]=> string(6) "newVal" ["bar2":"Foo":private]=> string(1) "b" }

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:
116.85 ms | 405 KiB | 5 Q