Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77950 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94367 invoked from network); 14 Oct 2014 08:05:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 08:05:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.54 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.192.54 mail-qg0-f54.google.com Received: from [209.85.192.54] ([209.85.192.54:36468] helo=mail-qg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/F1-15889-259DC345 for ; Tue, 14 Oct 2014 04:05:39 -0400 Received: by mail-qg0-f54.google.com with SMTP id z107so7786511qgd.41 for ; Tue, 14 Oct 2014 01:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=hiS84en6K00w9pTXTyeM4jMeJQKhhvmAseeTRjiNtKU=; b=usyWunTdp3axWiYM3yUphVrA5NJT/CmN7S3sJsczSdQW7ztfdAnxabtHVOtbUmH6cp rEhiHGrdQPtBRIihtF0CRRdYBLnBED8MxQFBwf1pnl3VT8+xGXIFSFFOjMWKKaEHbxLJ 7/1UxvSIxbvhC0zyEXlwUnxlMW/dpVcejGOTAvtYQcvGHOIDL/5sBA1ylP4Kx4F/7HBP K1uL+GuvKaUBd5YMEcuQUDVaiREdSfY13TdYhgx7vCFC+wkuCNQGv1fccDFpWjX3Fe5u r/ByiaY5dBXrdCmFG8cT/qhRry9e+X+6iwPOQuRCaADdQq85KCkYltfilKnuovDiXz8i CJug== X-Received: by 10.229.34.73 with SMTP id k9mr6526246qcd.3.1413273936349; Tue, 14 Oct 2014 01:05:36 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.140.23.71 with HTTP; Tue, 14 Oct 2014 01:04:56 -0700 (PDT) In-Reply-To: <543CCFEA.2080908@sugarcrm.com> References: <543C9E9F.80804@mabe.berlin> <543CCFEA.2080908@sugarcrm.com> Date: Tue, 14 Oct 2014 10:04:56 +0200 X-Google-Sender-Auth: DW_HfkEtbBEau1kx0Z25ANjOeoY Message-ID: To: Stas Malyshev Cc: Marc Bennewitz , PHP Internals List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7 From: jpauli@php.net (Julien Pauli) On Tue, Oct 14, 2014 at 9:25 AM, Stas Malyshev wrote: > Hi! > >> ... like the hidden array element: http://3v4l.org/6uFqf >> ... like the hidden object property: http://3v4l.org/RPJXH > > The issue seems to be that array lookup always looks for numeric results > when looking for numeric-like keys. But when adding property, the > numeric check is not done since properties are not supposed to be > numeric. Thus, when converting the object to array, the property named > "123" becomes inaccessible, because in array it is supposed to be under > number 123. > > We could, of course, add numeric checks to properties, but it would slow > things down only to serve very narrow use case with hardly any legit > uses. We could also rewrite hashtable with numeric keys instead of > string keys when doing conversion, but again that would be significant > slowdown for a very rare use case. Not sure it's worth it. I agree that fixing a strange behavior - very little people know about and very few little people use in real case - involving performance penalty for any other use case ; should be a -1 of course. Let's say the behavior is here "by design" ;-) Julien.Pauli