Fale / isbn

PHP ISBN library
GNU Affero General Public License v3.0
84 stars 16 forks source link

"Invalid octal literal" #10

Closed whisller closed 8 years ago

whisller commented 9 years ago

Hey, today I wanted to add your library to my project, and php complained with an error message "Invalid octal literal - won't be reported by PHP but will work incorrectly".

It is inside of file vendor/fale/isbn/src/Isbn/Hyphens.php lines e.g. 144, 173, 191 etc. Everywhere where you did convertion to octals.

Some links:

Fale commented 9 years ago

They are not octals, they are int. Which version of PHP are you using? Which Operative System and/or distribution?

dwightwatson commented 8 years ago

It looks as though PHP 7 will now interpret any integer that begins with a 0 as an octal (see this reference of changes in PHP 7).

The integers that begin with 0 in Hyphens.php simply need to have that zero removed and the code should continue to function. Happy to make a pull request that fixes this if you're interested @Fale.

Also it might be worthwhile adding PHP 7 as a platform on Travis CI (as an allowed failure) to facilitate in getting this package up to scratch for the new release.

lasselehtinen commented 8 years ago

I bumped in to the same issue. I have created a PR for this.

https://github.com/Fale/isbn/pull/12

Fale commented 8 years ago

Thanks for the bug and thanks to @lasselehtinen for the patch that has just been merged!

dwightwatson commented 8 years ago

Would you be able to tag a new release for the two recently merged PRs?

Not sure if you're following semantic versioning or not, but as the exceptions PR is a breaking change you might consider bumping to 3.0.0.

Fale commented 8 years ago

Thanks for remembering me. Just done it :)

dwightwatson commented 8 years ago

Awesome, thanks so much!