From: iam4webwork at hotmail dot com Operating system: PHP version: Irrelevant Package: *General Issues Bug Type: Bug Bug description:lack of error message
Description: ------------ PHP fails to display error messages consistently when user provides invalid octals. Test script: --------------- $octal = 00812; $another = 00934; var_dump( $octal, $another); $will_error = 01c; var_dump( $will_error ); The first two octals PHP accepts as valid input, and silently truncates each. It only displays an error message for 01c and mentions the 'c' being a problem. Why doesn't PHP consistently reject invalid octal values and display error messages? Expected result: ---------------- I expected error messages to result for each of the first two invalid octals. Instead PHP blindly accepted them while having each evaluate as zero. It only caught on to 01c being a bad octal value. Actual result: -------------- int 0 int 0 Parse error: syntax error, unexpected 'c' (T_STRING) in ... -- Edit bug report at https://bugs.php.net/bug.php?id=63705&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63705&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63705&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63705&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63705&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63705&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63705&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63705&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63705&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63705&r=support Expected behavior: https://bugs.php.net/fix.php?id=63705&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63705&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63705&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63705&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63705&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63705&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63705&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63705&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63705&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63705&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63705&r=mysqlcfg