3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hoge { private $hoge = null; private $fuga = null; public function __construct($hoge = []) { $this->set($hoge); } private function set($hoge = []) { foreach ($this as $key => $value) { $this->$key = (true === isset($hoge[$key])) ? $hoge[$key] : $value; var_dump($key, $value, $hoge[$key]); } } } $hoge = new Hoge(['hoge' => 1111, 'fuga' => 2222]);
Output for git.master, git.master_jit, rfc.property-hooks
string(4) "hoge" NULL int(1111) string(4) "fuga" NULL int(2222)

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:
52.05 ms | 401 KiB | 8 Q