note 120688 deleted from language.oop5.overloading by cmb

From: Date: Sun, 03 Mar 2019 11:37:20 +0000
Subject: note 120688 deleted from language.oop5.overloading by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210310@lists.php.net to get a copy of this message
Note Submitter: mfdboy at 163 dot com ---- class MethodTest { public static function __callStatic($name, $arguments) { // Note: value of $name is case sensitive. echo "Calling Non-static,private method '$name' " . implode(', ', $arguments). "\n"; } public function runTest($arguments){ //TODO } } MethodTest::runTest('in static context'); if you write code like this,php will display error PHP Strict standards: Non-static method MethodTest::runTest() should not be called statically class MethodTest { public static function __callStatic($name, $arguments) { // Note: value of $name is case sensitive. echo "Calling Non-static,private method '$name' " . implode(', ', $arguments). "\n"; } private function runTest($arguments){ //TODO } } MethodTest::runTest('in static context'); but this won't It means public Non-static method is not inaccessible

« previous php.notes (#210310) next »