Skip to content

Instantly share code, notes, and snippets.

View pjdietz's full-sized avatar

PJ Dietz pjdietz

View GitHub Profile
@pjdietz
pjdietz / AutomaticProperties.php
Last active December 11, 2015 15:39
Simple implementation of magic accessor methods (__get, __set, __isset, __unset) for PHP classes.
<?php
/*
* Use these methods to create automatic properties. When a property would be accessed,
* PHP will look for a function prefixed with get, set, isset, or unset followed by
* the property name with the first name capitalized. For example, the $this->name
* would be accessed as getName(), setName(), issetName(), and unsetName().
*/
/**