3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $_data = array(); public function set($data, $append = false) { if ($append) { $data = self::merge($this->_data, $data); } $this->_data = array(); foreach ($data as $key => $value) { $data = &$this->_data; $data = &$data[$key]; $data = $value; } } public static function merge($firstArray, $array) { foreach ($array as $key => &$value) { $firstArray[$key] = &$value; } return $firstArray; } } $query = new A; $query->set(array('param' => '1')); $query->set(array(), true);
Output for git.master, git.master_jit, rfc.property-hooks

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