Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91109 invoked from network); 4 Oct 2016 17:26:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Oct 2016 17:26:33 -0000 Authentication-Results: pb1.pair.com header.from=php@duncanc.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@duncanc.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain duncanc.co.uk from 209.85.215.43 cause and error) X-PHP-List-Original-Sender: php@duncanc.co.uk X-Host-Fingerprint: 209.85.215.43 mail-lf0-f43.google.com Received: from [209.85.215.43] ([209.85.215.43:33411] helo=mail-lf0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/B9-06241-846E3F75 for ; Tue, 04 Oct 2016 13:26:33 -0400 Received: by mail-lf0-f43.google.com with SMTP id t81so123473515lfe.0 for ; Tue, 04 Oct 2016 10:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duncanc-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DQJvYieYbnFQ+j+tefOnQFuoyroiM0idkN3F65Yod9c=; b=pWXIwvQt3nZETYd1Gp/mfTOL7OFl99f6Gy+vt9XV/M3crdj2M7UpNOV/1nmUOBT1Ya G/qiED9fw7JGbQ0t47y5PAGJtbwd3RyqiP/dTrRZCsTd7nptICqxqk509CPtTFaqtOBD Mo1T6Sf9rAI5Dwch5EaSVFBf98HBOR+iA0LoR+Z3LsXmt1ti7CuFyPIc+eTwYD6eh7V6 aloEGZUdiKYx9/4DM3921RdsstOzwNXrK2Dus7nw8EPVyn/QYJYoJybwoI743SItqfKX WZBYQ6JNq/AT/uJYpNyLkZ31g3+Rer3DbuqV7Moq2MflfSbU4M5hJ4k0sH+MYzHztXLH k+cg== 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:from:date :message-id:subject:to:cc; bh=DQJvYieYbnFQ+j+tefOnQFuoyroiM0idkN3F65Yod9c=; b=e4lKwhciedP4TBtkm5X4ifb85jlLQv4PzutuiU5ZhuUtq2LbuJVUVkA6KEmS/QlI8r Y/8yHzkWkzQyn2iNUROakwQQqv3EoXlB6kCwIOaRwx1w/tNZB+r6O5QY2hx/LsTLj6LY 7vh8J28GPtqKEsUHgmu0KAVq/IgLk/Cqi3yHIkPcoB5gF4majCr5yscA489/PFXNDi4d LBGI77ZmCy6m3lWaH5XCWqqDU1kKmhGLygFaG+SDfRTQKcom2IocFG5NQPxLQPTC3usF B4rZoGzQ4sF37H61YOplS4S4STl30rQCxkFZSdqLn5y8UQ+BTNu69N7vH1k5LxZM9Znn SJtg== X-Gm-Message-State: AA6/9RkrJuHUxuJByITuC1YFZdLJNdOTREZvLy7s7FAVwO9gmhzY7Trx2J1Z/ZfRosKPPA== X-Received: by 10.25.162.72 with SMTP id l69mr2227339lfe.9.1475601989047; Tue, 04 Oct 2016 10:26:29 -0700 (PDT) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com. [209.85.215.45]) by smtp.gmail.com with ESMTPSA id b71sm875406lfb.42.2016.10.04.10.26.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Oct 2016 10:26:28 -0700 (PDT) Received: by mail-lf0-f45.google.com with SMTP id b81so71760716lfe.1 for ; Tue, 04 Oct 2016 10:26:27 -0700 (PDT) X-Received: by 10.46.33.65 with SMTP id h62mr2020019ljh.39.1475601987216; Tue, 04 Oct 2016 10:26:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.120.163 with HTTP; Tue, 4 Oct 2016 10:26:26 -0700 (PDT) X-Originating-IP: [86.169.136.131] In-Reply-To: References: Date: Tue, 4 Oct 2016 18:26:26 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: Internals Content-Type: multipart/alternative; boundary=001a1142b5b24741e3053e0d5c06 Subject: Re: [PHP-DEV] [RFC] Counting of non-countable objects From: php@duncanc.co.uk (Craig Duncan) --001a1142b5b24741e3053e0d5c06 Content-Type: text/plain; charset=UTF-8 On 4 October 2016 at 18:10, Nikita Popov wrote: > > A confounding factor is that count() has an alias sizeof() and for people > coming from a C-like background it is quite natural to try to apply > sizeof() to a string in order to get its length. This will silently "work", > but return a meaningless result. > > So, definitely +1 on a warning for all non-array non-Countable cases. > > Ok, but if we're saying that count("string") === 1 is no longer a feature then presumably it makes sense to deprecate in 7.2 and remove in 8.0? Just raising a warning but still providing the feature feels weird to me --001a1142b5b24741e3053e0d5c06--