note 91980 modified in language.oop5.late-static-bindings by danbrown
| From: | danbrown@php.net | Date: | Fri, 03 Jul 2009 13:29:39 +0000 |
| Subject: | note 91980 modified in language.oop5.late-static-bindings by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157879@lists.php.net to get a copy of this message | ||
Something you may find useful for passive code-testing:
<?php
class BaseClass {
function __get($id) {
throw new Exception("Trying to access undefined property '$id'.");
}
function __set($id) {
throw new Exception("Trying to access undefined property '$id'.");
}
}
class MyClass extends BaseClass {
// my implementation
}
?>
Using these magic function as described above will help you to find classes that try to access an
undefined (and undocumented) class-member. In most cases: this is an error based on misspelled
member names.
--was--
Something you may find useful for passive code-testing:
class BaseClass {
function __get($id) {
throw new Exception("Trying to access undefined property '$id'.");
}
function __set($id) {
throw new Exception("Trying to access undefined property '$id'.");
}
}
class MyClass extends BaseClass {
// my implementation
}
Using these magic function as described above will help you to find classes that try to access an
undefined (and undocumented) class-member. In most cases: this is an error based on misspelled
member names.
http://php.net/manual/en/language.oop5.late-static-bindings.php