Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80334 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95948 invoked from network); 10 Jan 2015 22:37:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2015 22:37:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:57068] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/26-48183-BA9A1B45 for ; Sat, 10 Jan 2015 17:37:32 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 1AC96B00087 for ; Sat, 10 Jan 2015 17:37:29 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id D20b4YTyKmU8 for ; Sat, 10 Jan 2015 17:37:29 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id ACA83B00085 for ; Sat, 10 Jan 2015 17:37:28 -0500 (EST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: Date: Sat, 10 Jan 2015 22:37:26 +0000 To: PHP internals Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) X-Mailer: Apple Mail (2.1993) Subject: [PATCH] Fix octal parsing (finally) From: ajf@ajf.me (Andrea Faulds) 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 parsing issues in future (e.g. the resurgence of the hex = addition bug), by erroring 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. Thoughts? -- Andrea Faulds http://ajf.me/