3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $variable = array('test' => 'hello world!', 'another_test' => 'hello world?'); public function __construct($var) { var_dump($this->variable); // this is the whole array you defined initially $this->variable = $var; // here the $var ('testing contents') overwrites `variable` var_dump($var); // 'testing contents' var_dump($this->variable); // $this->variable is now the same as the argument passed in } } new Test('testing contents');
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["test"]=> string(12) "hello world!" ["another_test"]=> string(12) "hello world?" } string(16) "testing contents" string(16) "testing contents"

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