Re: Parse error: parse error, unexpected '='
| From: | Elfyn McBratney | Date: | Tue, 20 Apr 2004 09:37:50 +0000 |
| Subject: | Re: Parse error: parse error, unexpected '=' | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183943@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 20 Apr 2004 08:24, Lasse Motroen wrote:
> I have received some code and am trying to run it. However, I get the
> following error:
>
> *Parse error*: parse error, unexpected '=', expecting ')'
>
> It happens on this line when &$args=array() is reached:
>
> function array_key_remove(&$args=array(), $keys=array(),$replacement=NULL)
>
> I have php-4.2.2-17 and Apache 2.0.40 installed, and am runnig RedHat 9.
> What's wrong, please help.
IN PHP4 you can't have a default value for a parameter given by reference:
&$args=array()
You will need to change that to a simple
&$args
for it to work with PHP4. However, in PHP5 (any version from b1, I believe),
you can have a default value for a parameter when given by referrence.
Elfyn
- --
Elfyn McBratney, EMCB
mailto:elfyn@emcb.co.uk
http://www.emcb.co.uk/
PGP Key ID: 0x456548B4
PGP Key Fingerprint:
29D5 91BB 8748 7CC9 650F 31FE 6888 0C2A 4565 48B4
Error: quote_machine(): Dry humour detected.
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
<< ~ Linux london 2.6.5-emcb-243 #2 i686 GNU/Linux ~ >>
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAhO9vaIgMKkVlSLQRAgu5AKCubWfkqcopm7ZXWuUamdPiRiW3gwCfVidL
5ixcr8l+91g2km7+VAPvYRM=
=6DUI
-----END PGP SIGNATURE-----