note 104861 added to function.forward-static-call
| From: | arthur dot techarts at gmail dot com | Date: | Tue, 12 Jul 2011 14:39:38 +0000 |
| Subject: | note 104861 added to function.forward-static-call | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-181435@lists.php.net to get a copy of this message | ||
Example to understand this function and difference with call_user_func:
class Beer {
const NAME = 'Beer!';
public static function printed(){
echo 'static Beer:NAME = '. static::NAME . PHP_EOL;
}
}
class Ale extends Beer {
const NAME = 'Ale!';
public static function printed(){
forward_static_call(array('parent','printed'));
call_user_func(array('parent','printed'));
forward_static_call(array('Beer','printed'));
call_user_func(array('Beer','printed'));
}
}
Ale::printed();
echo '</pre>';
----
Server IP: 93.93.89.7
Probable Submitter: 193.200.32.160
----
Manual Page -- http://www.php.net/manual/en/function.forward-static-call.php
Edit -- https://master.php.net/note/edit/104861
Del: integrated -- https://master.php.net/note/delete/104861/integrated
Del: useless -- https://master.php.net/note/delete/104861/useless
Del: bad code -- https://master.php.net/note/delete/104861/bad+code
Del: spam -- https://master.php.net/note/delete/104861/spam
Del: non-english -- https://master.php.net/note/delete/104861/non-english
Del: in docs -- https://master.php.net/note/delete/104861/in+docs
Del: other reasons-- https://master.php.net/note/delete/104861
Reject -- https://master.php.net/note/reject/104861
Search -- https://master.php.net/manage/user-notes.php