Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98337 invoked from network); 14 Jun 2010 12:09:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2010 12:09:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.6 Received: from [195.226.6.51] ([195.226.6.51:56263] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/F4-07295-ADB161C4 for ; Mon, 14 Jun 2010 08:08:59 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 66296192E31; Mon, 14 Jun 2010 14:08:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at gna.ch Received: from mail.gna.ch ([127.0.0.1]) by localhost (gna.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ln+EF9vmJ4jr; Mon, 14 Jun 2010 14:08:55 +0200 (CEST) Received: from [192.168.1.72] (80-219-160-142.dclient.hispeed.ch [80.219.160.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 824E215E31A; Mon, 14 Jun 2010 14:08:54 +0200 (CEST) Message-ID: <4C161BD5.6060209@cschneid.com> Date: Mon, 14 Jun 2010 14:08:53 +0200 User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: Frederic Hardy CC: PHP internals References: <4C1275AB.8000201@moonspot.net> <4C136A6B.3090902@mageekbox.net> In-Reply-To: <4C136A6B.3090902@mageekbox.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Detecting if a null variable exists? From: cschneid@cschneid.com (Christian Schneider) Frederic Hardy wrote: >> I however have never seen a proper usecase.. > > class foo { > public function __call($method, $arguments) > { > // We MUST have at least ONE argument ! > if (array_key_exists(0, $arguments) === false) // > isset($arguments[0]) return false if first argument has null value Why not simply if (count($arguments) == 0) .. which is simpler and clearer? I agree with Hannes that most "usecases" should be solved differently anyway. - Chris