Re: Using functions before they're defined

From: Date: Fri, 08 Feb 2002 04:15:13 +0000
Subject: Re: Using functions before they're defined
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83964@lists.php.net to get a copy of this message
On Friday 08 February 2002 06:17, Martin Towell wrote: > I've found that you can specify a function anywhere in the page and call it > anywhere in the page so: > > <? > foobar(); > function foobar() { echo "in foobar<br>\n"; } > foobar(); > ?> > > would work and display the text twice, without errors/warnings > > I haven't looked at the php's source code, but maybe it's a two pass parser > (??) first it gets all the functions then it executes the code ???????? Yes, it's all explained in the manual :) -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Charlie was a chemist, But Charlie is no more. For what he thought was H2O, Was H2SO4. */

« previous php.general (#83964) next »