Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84413 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23832 invoked from network); 7 Mar 2015 19:42:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2015 19:42:38 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:37938] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/34-29230-DA45BF45 for ; Sat, 07 Mar 2015 14:42:37 -0500 Received: by lbiz12 with SMTP id z12so41096729lbi.5 for ; Sat, 07 Mar 2015 11:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=U2XwXvIgPhOzWm2TWwVDvAArxlLgNmjrpITgkwVYQN4=; b=QcmApV/ulaBZqXGpxc+MpQigPE9dy+ajvpaSzKX5CxiNBHIHwscpLllkXwF0ebcCbL rmLZMquKph0NvNwhMP2tLz3vSF8gfJ9wagHUResABmM45t2u4GBg+hCVRC+qQroTa+46 rk4u2jND6RHxlnVGEhsCPcRgv2Q9VIXmrGByAe3H5hrinfg6CRJxOd377f2sXpXROo/R oElo5CkjbsuR3PEwBTaVjdWKk84aWi+zRtyG/iSYbrtm6SLAD0ZUOWkSXmQiw3ZgyVni y7OOsUCo3TepV19UXYz8GDaUL1dNetKoEOyre8vcGrgiT6MgpUvTUE+Y4ZzFZLpZT66x KFow== MIME-Version: 1.0 X-Received: by 10.112.215.9 with SMTP id oe9mr18752589lbc.40.1425757354498; Sat, 07 Mar 2015 11:42:34 -0800 (PST) Sender: kalle.php@gmail.com Received: by 10.112.28.9 with HTTP; Sat, 7 Mar 2015 11:42:34 -0800 (PST) In-Reply-To: References: Date: Sat, 7 Mar 2015 20:42:34 +0100 X-Google-Sender-Auth: K7ZToQUWW6Ql23zOa9Oy68wcq9w Message-ID: To: "Sebastian B.-Hagensen" Cc: reeze , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [Discussion] Deprecate function sizeof() From: kalle@php.net (Kalle Sommer Nielsen) Hi 2015-03-07 18:35 GMT+01:00 Sebastian B.-Hagensen : > Hi, > I don't think the alias make sense and is really misleading and I've > seen sizeof("abc"); often enough (Don't get me wrong that's equally > bad with count, but sizeof encourages that usage, imo). > Having two functions that do exactly the same using different names > for no good reason (one of them referring to a different operation in > a more popular language) isn't optimal. Code using a deprecated sizeof > call is trivial to fix. Well we could make count()/sizeof() work for strings, so that if: C:\> php -r "echo sizeof('abc');" 3 although it would not really accomplish much imo., I think it is more of what background you come from that makes the most sense to me, I got into PHP before C and I enjoy sizeof more for array sizes than count, but that is just a pure preference. -- regards, Kalle Sommer Nielsen kalle@php.net