3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyCl { protected $db = "Hello"; public function __get($property) { return $this->db; } } $obj = new MyCl(); $greet = $obj->db; var_dump($greet);
based on cp8i7
Output for 5.6.38 - 7.3.0rc3
string(5) "Hello"