Quantcast
Browsing latest articles
Browse All 3 View Live

Answer by Nic Wortel for PHP getter and setter

Unfortunately, PHP does not have the getter and setter syntax you are referring to. It has been proposed, but it didn't make it into PHP (yet).First of all, __get() is only executed if you are trying...

View Article


Answer by Zander Rootman for PHP getter and setter

Untested.. Should work though. Using more magic methodology.class ProjectSettingsViewModel{ protected $ProjectAppCount = 0; public $ProjectApps = array(); public function __get( $property ) { switch(...

View Article


PHP getter and setter

I have a class:class Test{ public $AppCount; public $Apps; // When $AppCount is accessed I want to return count( $this->Apps )}When I access property $AppCount, I want to return count(...

View Article
Browsing latest articles
Browse All 3 View Live