PHP isset($this) and using the same object method in a static and object context
I'm working on a class which needs to be accessible via static function calls as well as object methods. One thing I have found is that I'm duplicating logic across multiple functions. Simplified example: class Configurable{ protected $configurations = array(); protected static $static_configurations = array(); public function configure($name, $value){ // ...lots of validation logic... $this->configurations[$name] = $value; } public static function static_configure($name, $value){ // ...lots of validation logic (repeated)... self::$static_configurations[$name] = $value; } } I've found a