Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95869 invoked by uid 1010); 10 Feb 2005 08:36:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95805 invoked from network); 10 Feb 2005 08:36:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2005 08:36:06 -0000 X-Host-Fingerprint: 84.204.52.251 promo.hnet.spb.ru OpenBSD 3.0-3.4 Received: from ([84.204.52.251:39330] helo=promo.hnet.spb.ru) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id AA/52-23634-1EC1B024 for ; Thu, 10 Feb 2005 03:35:46 -0500 Received: from w2k (unknown [192.168.3.118]) by promo.hnet.spb.ru (Postfix) with ESMTP id ECB361BAC51; Thu, 10 Feb 2005 11:34:33 +0300 (MSK) To: "'val khokhlov'" , Date: Thu, 10 Feb 2005 11:39:45 +0300 Message-ID: <000001c50f4c$12c6b270$0a02a8c0@w2k> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <418303929.20050209210703@vk.kiev.ua> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal Subject: RE: [PHP-DEV] php5.1: bug or feature? From: dmitry@zend.com ("Dmitry Stogov") References: <418303929.20050209210703@vk.kiev.ua> 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 > >