Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84631 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57036 invoked from network); 12 Mar 2015 12:06:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2015 12:06:20 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.213.47 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.213.47 mail-yh0-f47.google.com Received: from [209.85.213.47] ([209.85.213.47:46499] helo=mail-yh0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/52-42021-63181055 for ; Thu, 12 Mar 2015 07:06:20 -0500 Received: by yhoc41 with SMTP id c41so7916873yho.13 for ; Thu, 12 Mar 2015 05:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=jOp3ZlrmLhm6Z0It4vTiWCeVg8hJ7pjM3IHcgQfTvwY=; b=Bhv6dIaazApHH2sGCTSBalFjMRD7nWeKeDzJ+aXRtjPMYPKqKeDWTVoGvcofPVSlD+ Cc7oHDFRSqSazQ5a8otYqzVERAqaK0vgVll/hBtJxwDhh3d/4+irZQjG7fPhCJJ6+3ae bSOLfj/L/xs4yC87BqXt/foKDDQq+S+kptmss5q5oJcfCKj6gpvjjSmmkqWJnx+vfcXP 9FzMpru4mWodqtGfpb5xX6wLBxwuffYqA4/I6jpdKbhTRo73ExJTuIsak9kvbuZqyiaF LTSZEJtkW63Wg//Io86OFvNtqvsNwfLlfxh8CmB82yyuis1l7Ha0EfeWumIgD39BNm15 m71g== X-Gm-Message-State: ALoCoQlROJ//S2+p63xGOQA5Paf5rVyrJsBFp3OEg/B9udh8OglcHoQjlj+mqKXm+hdrRWATPawa MIME-Version: 1.0 X-Received: by 10.236.63.228 with SMTP id a64mr41260152yhd.41.1426161972640; Thu, 12 Mar 2015 05:06:12 -0700 (PDT) Received: by 10.170.71.86 with HTTP; Thu, 12 Mar 2015 05:06:12 -0700 (PDT) X-Originating-IP: [78.147.4.32] In-Reply-To: References: Date: Thu, 12 Mar 2015 12:06:12 +0000 Message-ID: To: Thomas Punt Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE] Make empty() a Variadic From: danack@basereality.com (Dan Ackroyd) On 12 March 2015 at 09:58, Thomas Punt wrote: > Hey PHP Internals, > I'm not entirely sure why > people are against it - and no one seems to want to debate it either. I think these were covered in the discussion phase, but I will reiterate the reasons I voted against it for clarity. > The falsy semantics of empty() means that inlining its behaviour to exactly match > isset() isn't logical. The problem isn't so much that the behaviour doesn't match some other pattern in PHP; the problem is that the function doesn't do what its name says it does. "if any arguments passed into empty() are considered falsy, then true will be returned" i.e. it doesn't check whether the arguments are 'empty', it's checking whether they are 'all set and not falsy'. Having a function do something different to what it's name suggests will lead to it being used incorrectly a lot of the time. The other reason I voted no, is that I just don't think this adds enough to the language to be implemented in core. For at least two of the examples in the RFC the desired functionality could be implemented in userland. The size of the PHP core codebase is already unwieldy. I think any suggested addition needs to have a clear advantage over being implemented in userland cheers Dan