NYCPHP Meetup

NYPHP.org

[nycphp-talk] QuickForm / PHP (Zend Engine) Bug - callback function never called

Daniel Convissor danielc at analysisandsolutions.com
Thu Mar 17 12:54:08 EST 2005


Jay:

On Thu, Mar 17, 2005 at 12:47:10PM -0500, Jayesh Sheth wrote:

> cause call_user_func to fail. Does anyone on this list know if someone 
> has deliberately designed PHP this way, and if so, why?

Yes.  A function has to be declared before you can use it.  Functions 
declared normally (outside conditional statements) are declared when the 
file is parsed.  Functions declared in conditional statements are declared 
during run time _when_ _execution_ _gets_ _to_ _them_.  So, you can solve 
your issue by reordering your script to put the function declaration above 
the is_callable() call.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list