-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print INT_MIN as -INT_MAX-1 to avoid it getting parsed as a float literal due to integer overflow.
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Bug #76717: var_export() does not create a parsable value for PHP_INT_MIN | ||
--FILE-- | ||
<?php | ||
|
||
$min = eval('return '.var_export(PHP_INT_MIN, true).';'); | ||
$max = eval('return '.var_export(PHP_INT_MAX, true).';'); | ||
var_dump($min === PHP_INT_MIN); | ||
var_dump($max === PHP_INT_MAX); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1fd32e9
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.
Looks like this break ext/standard/tests/general_functions/var_export_basic1.phpt on 32-bit
This seems to be expected, @nikic can you please check ?
1fd32e9
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.
Yeah, those results are expected, the test expectation just needs to be changed.
1fd32e9
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.
Also ext/standard/tests/general_functions/var_export-locale.phpt
1fd32e9
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.
@nikic thanks for confirming.
I will add a skip condition for 32-bit on those 2 tests (and probably duplicate them for 32-bit which have different output).
1fd32e9
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.
Tests fixed in a467a89
1fd32e9
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.
Thanks!