Re: [PHP4BETA] Is this a bug? Default params?
| From: | George Hartz | Date: | Mon, 09 Aug 1999 16:38:09 +0000 |
| Subject: | Re: [PHP4BETA] Is this a bug? Default params? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3241@lists.php.net to get a copy of this message | ||
Samuel Liddicott wrote:
>
> This
>
> Function isAdmin($username = "$login[username]") {
> return 0;
> }
>
> Was valid under php 3.0.5, but the first line gives a parse error with php4.
> As does
>
> Function isAdmin($username = $login[username]) {
> and
> Function isAdmin($username = $login["username"]) {
> and
> Function isAdmin($username = "$login[\"username\"]") {
>
> Should it have worked in php3 (it did)? Why doesn't it now? Are only
> constants allowed as default params???
I caught that problem when Beta1 first came out. I was told its a
non-supported feature, not a bug. (ie, its not going to change.)
It was a real headache for me, I used that functionality literally
hundreds of times on a dozen sites.
- George
--
email:dotorg@bangsplat.org;url:www.bangsplat.org;uin:153182;aim:tgd98
GCS/GP/GS/GFA d- s+: a- C++++$ UL++++$ P+++$ L+++$ E- W++>$ N+@ !o
K+++ w--- !O M-@ V PS+ PE Y+ PGP t-(+) 5- X++ R-(--) tv+ b+++ DI++ D++
G+ e* h r y++