note 80310 added to language.oop5.overloading

From: Date: Wed, 09 Jan 2008 15:45:50 +0000
Subject: note 80310 added to language.oop5.overloading
Groups: php.notes 
Request: Send a blank email to php-notes+get-134970@lists.php.net to get a copy of this message
it should be noted that __call will trigger only for method calls on an instantiated object, and cannot be used to 'overload' static methods. for example: <?php class TestClass { function __call($method, $args) { echo "Method {$method} called with args: " . print_r($args, TRUE); } } // this will succeed $obj = new TestClass(); $obj->method_doesnt_exist(); // this will not TestClass::method_doesnt_exist(); ?> It would be useful if the PHP devs would include this in a future release, but in the meantime, just be aware of that pitfall. ---- Server IP: 69.147.83.197 Probable Submitter: 65.106.220.162 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php Edit -- https://master.php.net/note/edit/80310 Del: integrated -- https://master.php.net/note/delete/80310/integrated Del: useless -- https://master.php.net/note/delete/80310/useless Del: bad code -- https://master.php.net/note/delete/80310/bad+code Del: spam -- https://master.php.net/note/delete/80310/spam Del: non-english -- https://master.php.net/note/delete/80310/non-english Del: in docs -- https://master.php.net/note/delete/80310/in+docs Del: other reasons-- https://master.php.net/note/delete/80310 Reject -- https://master.php.net/note/reject/80310 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#134970) next »