Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14770 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68501 invoked by uid 1010); 9 Feb 2005 19:07:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68480 invoked from network); 9 Feb 2005 19:07:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2005 19:07:12 -0000 X-Host-Fingerprint: 62.244.34.170 vk.kiev.ua NetCache 5.3-5.5 Received: from ([62.244.34.170:57325] helo=ivory.vk.kiev.ua) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id F0/E9-30278-C5F5A024 for ; Wed, 09 Feb 2005 14:07:09 -0500 Received: from [192.168.0.8] (helo=ROCK) by ivory.vk.kiev.ua with esmtp (Exim 4.43) id 1CyxAv-000BN9-F0 for internals@lists.php.net; Wed, 09 Feb 2005 21:06:57 +0200 Date: Wed, 9 Feb 2005 21:07:03 +0200 X-Priority: 3 (Normal) Message-ID: <418303929.20050209210703@vk.kiev.ua> To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [PHP-DEV] php5.1: bug or feature? From: val@vk.kiev.ua (val khokhlov) 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