> -----Original Message-----
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: 18 February 2003 15:14
> 
> I have a script, "registration.php", which calls require_once on the 
> Registrant.class file mentioned in the above error message.  The 
> Registrant::setPhone() method is called more than once.  Since it is 
> called more than once, the function "isValidPhoneNumber()" defined 
> within setPhone() is defined more than once, which I suspect is the 
> source of the problem.  Does PHP not allow you to define a function 
> within a function and then call the enclosing function more 
> than once?  

Well, it kinda does, but as it doesn't limit the scope in any way there's
not really any point.  Besides, it can lead to the kind of problems you're
experiencing.  Just declare the two functions sequentially in your include
file.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to