3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Magic { public $a = "A"; protected $b = [ "a" => "A", "b" => "B", "c" => "C" ]; protected $c = [1, 2, 3]; public function __get($v) { echo "$v, "; return $this->b[$v]; } public function __set($var, $val) { echo "$var: $val,"; $this->$var = $val; } } $m = new Magic(); echo $m->a;
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
A