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 = 0109; // same as 010, or 8

I see no particular reason why this behaviour should be preserved. I’ve 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’t 
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/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to