#22866 [Opn->Fbk]: Variable function call on object method fails

From: Date: Wed, 09 Apr 2003 21:47:56 +0000
Subject: #22866 [Opn->Fbk]: Variable function call on object method fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37476@lists.php.net to get a copy of this message
ID: 22866 Updated by: sniper@php.net Reported By: tys at cs dot ualberta dot ca -Status: Open +Status: Feedback Bug Type: Class/Object related Operating System: Linux PHP Version: 4.3.1 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Previous Comments: ------------------------------------------------------------------------ [2003-03-25 00:36:06] tys at cs dot ualberta dot ca A variable function can be called on a normal function just fine: ------------------------------ function test() { return "test1"; } $function = "test"; echo $function(); ------------------------------ This outputs: test However trying the same thing on a funciton inside a class will fail: ------------------------------ class Test { function Test() { } function testClass() { return "test 2"; } } $function = "Test::testClass"; echo $function(); ------------------------------ Calling: echo Test::testClass(); works fine, however the above code does not. It should output: test 2 However it returns an error similar to the following: Fatal error: Call to undefined function: registration::formatdate() in /home/gaza/public_html/fp_php/support/table.php on line 396 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22866&edit=1

« previous php.bugs (#37476) next »