Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42857 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59181 invoked from network); 27 Jan 2009 13:34:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2009 13:34:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.134 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.134 mailout2.netbeat.de Linux 2.6 Received: from [83.243.58.134] ([83.243.58.134:44193] helo=mailout2.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/A7-12464-B4D0F794 for ; Tue, 27 Jan 2009 08:34:06 -0500 Received: (qmail 21377 invoked by uid 89); 27 Jan 2009 13:52:31 -0000 Received: from unknown (HELO ?192.168.1.103?) (johannes%schlueters.de@93.104.55.82) by mailout2.netbeat.de with ESMTPA; 27 Jan 2009 13:52:31 -0000 To: Christopher Jones Cc: "Nathanael D. Noblet" , internals@lists.php.net In-Reply-To: <497E5DF6.4060606@oracle.com> References: <497E1FFB.5050404@gnat.ca> <497E5DF6.4060606@oracle.com> Content-Type: text/plain Date: Tue, 27 Jan 2009 14:33:59 +0100 Message-ID: <1233063239.8505.10.camel@goldfinger> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] substr passing null... From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Mon, 2009-01-26 at 17:05 -0800, Christopher Jones wrote: > > Nathanael D. Noblet wrote: > > Hello, > > I just have a question, often there are 'optional' parameters to > > functions, I've always thought that most of the time I could pass null > > to these if I wanted to leave one empty. This has as far as I can tell > > always worked except recently I was using substr(). If I pass null to > > the third param, I get nothing back. Isn't passing null the same as not > > passing anything? Is this a bug? Or is my logic flawed? > > > > > > I know Ilia recently fixed a few functions that didn't ignore null > parameters, but it doesn't appear that substr() was one of them. I guess that's part of the zend_parse_parameters changes. As we now use the "s" modifier for instance which might better be a "s!". We should certainly spent some time on checking these things. All remember: We're feature freezing, so spend time on finding and fixing bugs instead of adding new ones! :-) (this includes users who can at least report such issues ... ) johannes