note 82008 deleted from language.oop5.paamayim-nekudotayim by googleguy
| From: | googleguy@php.net | Date: | Thu, 18 Feb 2016 04:10:24 +0000 |
| Subject: | note 82008 deleted from language.oop5.paamayim-nekudotayim by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-204972@lists.php.net to get a copy of this message | ||
Note Submitter: richard at richard-sumilang dot com
----
Actually, for people not using PHP 5.3 yet you should try avoiding the use of a eval() at all costs!
THere are too many security risks and dirty code that come from using eval. If you want to call a
static method from a class then you can use call_user_func() instead which is much safer.
Example:
clas Foo{
public static method Bar(){
echo "Hello world!";
}
}
And to execute that with call_user_func you would do the following:
call_user_func(array('Foo', 'bar') [, $params] );
Thanks,
- Richard S.