Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
class Regular
public $name = 'Something';
class Magic
private $values = ['name' => 'Something'];
public function __get($key)
if (isset($this->values[$key])) {
return $this->values[$key];
$regular = new Regular;
$magic = new Magic;
// Hasil:
// bool(false)
// bool(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment