Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46685 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38736 invoked from network); 13 Jan 2010 13:36:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2010 13:36:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=mathieu.suen@easyflirt.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mathieu.suen@easyflirt.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain easyflirt.com designates 91.199.255.56 as permitted sender) X-PHP-List-Original-Sender: mathieu.suen@easyflirt.com X-Host-Fingerprint: 91.199.255.56 python-06.easyrencontre.com Linux 2.6 Received: from [91.199.255.56] ([91.199.255.56:40398] helo=mail.easyflirt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/EC-00773-56CCD4B4 for ; Wed, 13 Jan 2010 08:36:38 -0500 Received: from [192.168.0.51] (office.easyrencontre.com [78.155.152.6]) by mail.easyflirt.com (Postfix) with ESMTPSA id 39B4F6374E0 for ; Wed, 13 Jan 2010 14:36:35 +0100 (CET) Message-ID: <4B4DCC64.3030703@easyflirt.com> Date: Wed, 13 Jan 2010 14:36:36 +0100 User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Inconsistency redesign From: mathieu.suen@easyflirt.com ("mathieu.suen") Hi, I came across this: echo sizeof(array()); echo sizeof(""); $a = ""; var_dump( empty($a)); $a = array(); var_dump(empty($a)); So funny! How something can have a size greater than 0 but still be empty? I think PHP is reinventing the inconsistency word. But then let assume that empty is just making a cast in array. $a = ""; empty($a) //true empty((array)$a) //false Ok so empty is big ugly switch case on type. empty(0); //true empty(45); //false Wooow reinventing emptiness on number.... -- Mathieu Suen