note 120688 added to language.oop5.overloading

From: Date: Wed, 22 Feb 2017 03:27:46 +0000
Subject: note 120688 added to language.oop5.overloading
Groups: php.notes 
Request: Send a blank email to php-notes+get-208776@lists.php.net to get a copy of this message
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 ---- Server IP: 72.52.91.14 Probable Submitter: 183.129.129.206 ---- Manual Page -- http://php.net/manual/en/language.oop5.overloading.php Edit -- https://master.php.net/note/edit/120688 Del: integrated -- https://master.php.net/note/delete/120688/integrated Del: useless -- https://master.php.net/note/delete/120688/useless Del: bad code -- https://master.php.net/note/delete/120688/bad+code Del: spam -- https://master.php.net/note/delete/120688/spam Del: non-english -- https://master.php.net/note/delete/120688/non-english Del: in docs -- https://master.php.net/note/delete/120688/in+docs Del: other reasons-- https://master.php.net/note/delete/120688 Reject -- https://master.php.net/note/reject/120688 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#208776) next »