3v4l.org

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