Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42873 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18220 invoked from network); 29 Jan 2009 06:47:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2009 06:47:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.186 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.128.186 fk-out-0910.google.com Received: from [209.85.128.186] ([209.85.128.186:38586] helo=fk-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/89-57186-31151894 for ; Thu, 29 Jan 2009 01:47:48 -0500 Received: by fk-out-0910.google.com with SMTP id b27so4220352fka.7 for ; Wed, 28 Jan 2009 22:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=ixKetXbfjV98BpsEKQMQ33MpQThDogIUOdRJ4LaKxx8=; b=vozoxhlMdzA3v/vcyVjRHg/MWUY0wDaaN9QQ2YKYmFBjAcdwcI5rJyG+uFBGLLNcl1 WFUmoLliCLafKFJy9BbZnzNkcUzQc1Ca+DDVVEsKfo5jJDRWzqnlGtnL19F/zUHww+9F q6c+rNKC0EP24lgAInqz4nEevGPpMA/30+Dx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=UqY8waQ6SR7swyTDImxG5C5yd9KaHXFov4WFYR7GtqHzNgoUSmAslAmfDdIEiAzDCu Ne3a7PXT0Qf11oWAWdwddmaSc9/n3D6buKy3eXjHGtdHU8Z48HmdmAZLWKPl+qH8iU31 n0uWcJLj9aidJNyDevVMU+SUZA3MtnAKjqK94= MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.223.113.136 with SMTP id a8mr4470923faq.76.1233211664769; Wed, 28 Jan 2009 22:47:44 -0800 (PST) In-Reply-To: References: <497E1FFB.5050404@gnat.ca> <497E5DF6.4060606@oracle.com> <1233063239.8505.10.camel@goldfinger> <497F37F8.6070407@gnat.ca> <49807F9E.4020401@pewasoft.com> <4980976D.60202@gnat.ca> <498098D7.2080901@macvicar.net> Date: Thu, 29 Jan 2009 07:47:44 +0100 X-Google-Sender-Auth: 5b71d6535fdfd64e Message-ID: <2dedb8a0901282247j7222aa5eq4401b95c383f2da0@mail.gmail.com> To: Kenan R Sulayman Cc: Paul Biggar , Dan , Scott MacVicar , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] substr passing null... From: kalle@php.net (Kalle Sommer Nielsen) Hello 2009/1/28 Kenan R Sulayman : > Why don't make the function return FALSE if parameter equals NULL ? Well the $start parameter is required for substr(), so I don't see the deal here? But with now initalizers being added in the manual by Jakub its not much of a deal to use those values if you wanna use the default anyway. For example mysql_connect: http://www.php.net/mysql_connect But I do agree that in the end it would be easier to just be able to pass NULL, but it can just have a different meaning ;) > > -- > (c) Kenan Sulayman > Freelance Designer and Programmer > > Life's Live Poetry > > > 2009/1/28 Paul Biggar > >> On Wed, Jan 28, 2009 at 6:39 PM, Dan wrote: >> >> >> >> You're assumption is wrong then, NULL isn't treated as not passing a >> >> value. The reason it worked with substr was by pure chance. >> >> >> > >> > Out of interest, is there a reason that that is the case? Surely passing >> > null would be best treated as the same as passing nothing? >> >> NULL is a value. There is no way to tell that when you pass NULL, you >> actually intended to pass nothing and use the default value. >> >> Paul >> >> >> -- >> Paul Biggar >> paul.biggar@gmail.com >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > -- Kalle Sommer Nielsen