-
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.
Fix leak on div by zero compound assignment with coercion
The result == op1 check did not work properly here, because op1 was &op1_copy at this point. Move the division by zero reporting out of the _base function, so it can check the original op1.
- Loading branch information
Showing
2 changed files
with
37 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Division by zero in compound operator with type coercion | ||
--FILE-- | ||
<?php | ||
$x = 42; | ||
try { | ||
$$x /= 0; | ||
} catch (DivisionByZeroError $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
?> | ||
--EXPECTF-- | ||
Warning: Undefined variable $42 in %s on line %d | ||
Division by zero |
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
540fed1
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 a lot .