RE: [PHP-DEV] php5.1: bug or feature?
| From: | Dmitry Stogov | Date: | Thu, 10 Feb 2005 08:39:45 +0000 |
| Subject: | RE: [PHP-DEV] php5.1: bug or feature? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-14785@lists.php.net to get a copy of this message | ||
This is the bug #30407. I will try to fix it ASAP.
Thanks. Dmitry.
> -----Original Message-----
> From: val khokhlov [mailto:val@vk.kiev.ua]
> Sent: Wednesday, February 09, 2005 22:07
> To: internals@lists.php.net
> Subject: [PHP-DEV] php5.1: bug or feature?
>
>
> Hello,
>
> in php5.1 i get default value of omitted parameter only
> the first time i call a function, all subsequent calls get
> the $tname set in the first call (like static!). in php5.0
> $tname is always empty if omitted (as it should be)
> php5.1 updated from cvs on 6.02.2005
>
> [code]
>
> function compile($sname, $tname = '') {
> if ($tname == '') $tname = preg_replace("!\.php$!", ".phb",
> $sname);
> echo " * source file: $sname\n * target file: $tname\n";
> ....
> }
> for ($i = 1; $i < $_SERVER['argc']; $i++) {
> $sname = $_SERVER['argv'][$i];
> compile($sname);
> }
>
> [output]
>
> $ ./php test.php *.php
> * source file: class.php
> * target file: class.phb
> > compiled
> * source file: class1.php
> * target file: class.phb
> > compiled
> * source file: class2.php
> * target file: class.phb
> > compiled
>
> --
> Best regards,
> val mailto:val@vk.kiev.ua
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>