Re: [PHP4BETA] new/fast API breaks passing array elements by value!
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: [PHP4BETA] new/fast API breaks passing array elements by value! | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4968@lists.php.net to get a copy of this message | ||
> That means we have to update all functions which change their
> original input parameters, because they rely on getting a
> copy which isn't true anymore.
>
> This is probably mostly true for string.c which contains/uses
> functions which edit their passed parameters.
For something like strtoupper(), it might be nice if you don't make a copy
if it is called using strtoupper(&$arg) and do make a copy if it is called
using strtoupper($arg)
I don't think it would be a backward compatibility problem since anybody
writing strtoupper(&$arg) was probably expecting it to work that way, but
since it didn't like ended up doing:
$arg = strtoupper(&$arg)
and this would still work fine and thus his code wouldn't break.
-Rasmus