RE: [PHP] Help on OOP

From: Date: Sun, 08 Dec 2002 00:23:42 +0000
Subject: RE: [PHP] Help on OOP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127407@lists.php.net to get a copy of this message
> -----Original Message----- > From: Khalid El-Kary [mailto:khalid_kary@hotmail.com] > Sent: Saturday, December 07, 2002 6:03 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Help on OOP > > hi, > a function can be defined from inside another function! > this works here: > > <?php > > function howru() > { > function hi() > { > echo "hi,"; > } > hi();echo "how r u"; > } > > howru(); > hi(); > > ?> > > this gives the same result: > > <?php > function hi() > { > echo "hi,"; > } > function howru() > { > hi();echo "how r u"; > } > > howru(); > hi(); > > ?> > > It seems that even calling the function again from any place works! So what your saying is that the hi() function's scope in the top example is not limited to the howru() function. > > Regards, > Khalid al-kary > > _________________________________________________________________ > Protect your PC - get McAfee.com VirusScan Online > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002

« previous php.general (#127407) next »