<?php class foo { protected $bar ; public function setBar ( $val ) { $this -> bar = $val ; } public function __get ( $var ) { return $this -> $var ; } } $obj = new foo ( ) ; $obj -> setBar ( 'Hello World' ) ; var_dump ( $obj -> bar ) ; var_dump ( empty ( $obj -> bar ) ) ; //fucking brilliant!

PD9waHAKCmNsYXNzIGZvbyB7Cglwcm90ZWN0ZWQgJGJhcjsKCQoJcHVibGljIGZ1bmN0aW9uIHNldEJhciAoJHZhbCkgewoJCSR0aGlzLT5iYXIgPSAkdmFsOwoJfQoJCglwdWJsaWMgZnVuY3Rpb24gX19nZXQgKCR2YXIpIHsKCQlyZXR1cm4gJHRoaXMtPiR2YXI7Cgl9Cn0KCiRvYmogPSBuZXcgZm9vICgpOwokb2JqLT5zZXRCYXIgKCdIZWxsbyBXb3JsZCcpOwoKdmFyX2R1bXAoJG9iai0+YmFyKTsKdmFyX2R1bXAoZW1wdHkoJG9iai0+YmFyKSk7IC8vZnVja2luZyBicmlsbGlhbnQhCg==