-
Notifications
You must be signed in to change notification settings - Fork 46
Fix number bases other than 10 #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ class TEST_1 | |
|
|
||
| public function test($input = 4) { | ||
| if ($input > 2) { | ||
| return 15; | ||
| return 015; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test should fail
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You think it should return 015 not 15 ?
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well if we a respecting base than yes. Also if we want to ignore number 0b10 but not dec 10 would it work?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are 2 separate numbers 0b10 would be ignored if you had 2 in the ignore list currently. so 0x2, 02, 2 and 0b1 would all be ignored by 2.. To get this to return like that we would need to add octal, hex and binary to the cases.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You won't be able to tell the difference between 0755 and 0o755 with this |
||
| } | ||
|
|
||
| for ($i = 3; $i <= 10; $i++) { | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case we are loosing base prefix (0 or 0b). Now dec 10 and binary 10 is displayed in the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would like more tests regarding this.