Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42856 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70239 invoked from network); 27 Jan 2009 01:06:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2009 01:06:34 -0000 Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 148.87.113.124 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 148.87.113.124 rcsinet12.oracle.com Received: from [148.87.113.124] ([148.87.113.124:21495] helo=rgminet12.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/00-03894-71E5E794 for ; Mon, 26 Jan 2009 20:06:32 -0500 Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0R15cuh028157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Jan 2009 01:05:40 GMT Received: from acsmt701.oracle.com (acsmt701.oracle.com [141.146.40.71]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0R161CY016089; Tue, 27 Jan 2009 01:06:02 GMT Received: from [130.35.70.24] (/130.35.70.24) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Jan 2009 01:05:59 +0000 Message-ID: <497E5DF6.4060606@oracle.com> Date: Mon, 26 Jan 2009 17:05:58 -0800 User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: "Nathanael D. Noblet" CC: internals@lists.php.net References: <497E1FFB.5050404@gnat.ca> In-Reply-To: <497E1FFB.5050404@gnat.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsmt701.oracle.com [141.146.40.71] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.497E5DF9.00CC:SCFSTAT928724,ss=1,fgs=0 Subject: Re: [PHP-DEV] substr passing null... From: christopher.jones@oracle.com (Christopher Jones) 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. Triple check the problem reproduces with the latest snapshot (snaps.php.net). If it's still broken then log a bug (bugs.php.net). Chris -- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM