3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace App\Support; use ArrayObject; final class Config extends ArrayObject { } $settings = [ 'section' => [ 'key1' => 'my_value_1', 'key2' => 'my_value_2', ], ]; $config = new Config($settings); //$config->setFlags(ArrayObject::ARRAY_AS_PROPS); print_r($config['section']); final class MyExample { private Config $config; public function __construct(Config $config) { $this->config = $config; } public function doSomething(): void { $value1 = $this->config['section']['key1']; // Output: my_value_1 echo $value1; } } $example = new MyExample($config); $example->doSomething();
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [key1] => my_value_1 [key2] => my_value_2 ) my_value_1

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