RE: [PHP] Class operator :: Problem
| From: | Scott Houseman | Date: | Tue, 03 Sep 2002 13:11:59 +0000 |
| Subject: | RE: [PHP] Class operator :: Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115019@lists.php.net to get a copy of this message | ||
Hi There
Try doing it this way:
<?
class a {
function test() {
echo "Hallo";
}
}
$testfunct = "a::test();";
eval($testfunct);
?>
Regards
-|Scott
> -----Original Message-----
> From: Unger, Christian [mailto:CUnger@PSI.de]
> Sent: Tuesday, September 03, 2002 2:51 PM
> To: 'php-general@lists.php.net'
> Subject: [PHP] Class operator :: Problem
>
>
> I have problems to make a dynamic call, please help me!!!!
>
> <?
> class a {
> function test() {
> echo "Hallo";
> }
> }
>
> $testfunct = "a::test";
>
> $testfunct();
>
> ?>
>
> returns:
> Fatal error: Call to undefined function: a::test() in
> /usr/local/share/version2.mypsi.de/index.html on line 10
>
> -----------------------------------------------
> Christian Unger
> IT-Consultant
>
> PSI Infrastruktur Services GmbH
> Dircksenstr. 42-44
> 10178 Berlin
>
> Tel: 030 / 2801 - 2536
> Fax: 030 / 2801 - 297 2536
> e-Mail: CUnger@psi.de
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>