Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11150 invoked from network); 31 Dec 2009 10:47:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2009 10:47:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.220.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.220.227 mail-fx0-f227.google.com Received: from [209.85.220.227] ([209.85.220.227:55316] helo=mail-fx0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/4D-12956-7318C3B4 for ; Thu, 31 Dec 2009 05:47:20 -0500 Received: by fxm27 with SMTP id 27so11609854fxm.23 for ; Thu, 31 Dec 2009 02:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=eojGySEThyUDvWGU1DzlmFMcrY/9LzbnQZJLOpgs5Gg=; b=t0e21/L6oO8/ruBOvMv/1y+alZ+lYGESTh7k1STuW1a7jvl8Uf9BcEEsvuoZD898H4 O13u843n7+/k2VLDG3+An8WNoH6dNgEa05Z43vkO3X/p1dZyz+bnCQA2h8bDQ7nxno6t 7LX0FVkyXFIsP627qUoLMphQpy1c6iYD1Nj+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=LfFy7kOYHLJGoESL4r4VB42ev+sg2UHtrNy3cHIQ0xJKPPZnRXHAjPJigomMMbepyQ vQUrRDXqfNXTYnhuu8BxMUlsnirVf5TrYk0WMxZWbZWHEY8JfYTIJNdnmDrHeEPY2jrt fyrH5Jy463nQI3G+TgZTAsbPVr0CIYsPiD7Ps= MIME-Version: 1.0 Received: by 10.223.4.132 with SMTP id 4mr1072798far.45.1262256436947; Thu, 31 Dec 2009 02:47:16 -0800 (PST) Reply-To: RQuadling@googlemail.com In-Reply-To: <4B3C7E0C.3030907@zend.com> References: <4B3C4041.6000406@zend.com> <10845a340912310226rdb09b26v12551fab5aedd5ae@mail.gmail.com> <4B3C7E0C.3030907@zend.com> Date: Thu, 31 Dec 2009 10:46:56 +0000 Message-ID: <10845a340912310246w230e8031qf659d336bacbe1cc@mail.gmail.com> To: Stanislav Malyshev Cc: Alexey Zakhlestin , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] invalid params return value From: rquadling@googlemail.com (Richard Quadling) 2009/12/31 Stanislav Malyshev : > Hi! > >> Would changing the returning value to Null to indicate invalid >> arguments (or any other error condition) would create a significant BC >> surely? Just how many functions are documented with the entity >> &return.falseforfailure;? (198 files using this so far vs Return >> &null; which is used very rarely). > > There are different kinds of failure. There's failure for the function (i.e. > function tried to do something and failed, like couldn't open the file) and > failure where function wheren't even executed (like you called fopen without > giving it a filename). Some functions return the same in both cases, some do > not. I'm sure half of the functions documented as &return.falseforfailure; > return NULL on incorrect args. > > As for BC - it may break some scripts that don't check properly but having > each function do different thing is worse, since you couldn't even write a > proper check - since you have no way of knowing what to check for. > Aha. I see, so, a big +1 for consistency for argument checking. -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling