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_dum($this->variable); // $this->variable is now the same as the argument passed in } } new Test('testing contents');

preferences:
52.13 ms | 402 KiB | 5 Q