Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27762 invoked from network); 11 Jan 2015 03:26:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2015 03:26:50 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.217.173 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.173 mail-lb0-f173.google.com Received: from [209.85.217.173] ([209.85.217.173:48960] helo=mail-lb0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/FB-48183-67DE1B45 for ; Sat, 10 Jan 2015 22:26:48 -0500 Received: by mail-lb0-f173.google.com with SMTP id z12so13380374lbi.4 for ; Sat, 10 Jan 2015 19:26:42 -0800 (PST) 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:content-type:content-transfer-encoding; bh=P5sRrm25qc62UkpUUcsm9gNaCFVjB/oiBlI2AJk+vhs=; b=dgJNmUfOmfIHACGBHy4fUjluMtABBa385MDnk8flFbRW2TG4ZcUGzfhblPC2kYvmDR lXQKhy8+goi2I+Zr1j4XMm6O+7V6acdHPdd21Kwy00Mrw51sXaQNb834j9UvBAxWE2qR h7RSV0wjHsoWERJ7308PE6Yqg/op6h/Btjb04Av3ITfPQlkOx4KU6AY4/ebc2Vp11JBi xdHKHe4EIwAEscTpozvYFxN7mBWmOT9uRsUM0oOJ6xts7cG4g8k4+nIs57cih4AsOZkT UvRvuzl/0MYaGsmZJMCZZu7AVd9Una8Vb9L7piraWq5ULK85++BglCJzE6OJ5Ko5DK5r ISxQ== X-Gm-Message-State: ALoCoQl4bI/13Q5MyDkszqDLzGdsZwZx+aQo15UdMC6prtSTCGsmYGFwbZfqINfHGc8eJJO6Lk2hsoSM4Q+btQThk+nUpqmgfHqNoMUXlH1MB3pIrnLAH7a+dG8WaPNKRHEtsCR2MPtvgh6hH3UfhHkRCoAO/F2OdQ== X-Received: by 10.152.45.65 with SMTP id k1mr30229369lam.14.1420946802054; Sat, 10 Jan 2015 19:26:42 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPSA id m9sm2950654laa.28.2015.01.10.19.26.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Jan 2015 19:26:40 -0800 (PST) Received: by mail-lb0-f169.google.com with SMTP id p9so13346172lbv.0 for ; Sat, 10 Jan 2015 19:26:39 -0800 (PST) X-Received: by 10.112.132.2 with SMTP id oq2mr29883037lbb.11.1420946799991; Sat, 10 Jan 2015 19:26:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.64.176 with HTTP; Sat, 10 Jan 2015 19:26:19 -0800 (PST) In-Reply-To: References: Date: Sun, 11 Jan 2015 11:26:19 +0800 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PATCH] Fix octal parsing (finally) From: laruence@php.net (Xinchen Hui) Hey: On Sun, Jan 11, 2015 at 6:37 AM, Andrea Faulds wrote: > Hey internals, > > A longstanding PHP bug is that invalid octal digits simply terminate the = literal and are ignored, rather than generating a compile error. Thus, this= is valid: > > $x =3D 0109; // same as 010, or 8 > > I see no particular reason why this behaviour should be preserved. I=E2= =80=99ve written a patch that would finally fix it, and avoid similar parsi= ng issues in future (e.g. the resurgence of the hex addition bug), by error= ing when strtol doesn=E2=80=99t reach the end of the literal. > > The pull request is here: https://github.com/php/php-src/pull/987 > > I think this would be an acceptable BC break for PHP 7. Agree, IMO previously behavior actually is a bug... thanks > > Thoughts? > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=20 Xinchen Hui @Laruence http://www.laruence.com/