Skip to content

Commit

Permalink
Add test for bug #78356
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Aug 1, 2019
1 parent afd9639 commit bab8b3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -6,6 +6,8 @@ PHP NEWS
. Fixed bug #78340 (Include of stream wrapper not reading whole file).
(Nikita)
. Fixed bug #78344 (Segmentation fault on zend_check_protected). (Nikita)
. Fixed bug #78356 (Array returned from ArrayAccess is incorrectly unpacked
as argument). (Nikita)

- Exif:
. Fixed bug #78333 (Exif crash (bus error) due to wrong alignment and
Expand Down
20 changes: 20 additions & 0 deletions Zend/tests/bug78356.phpt
@@ -0,0 +1,20 @@
--TEST--
Bug #78356: Array returned from ArrayAccess is incorrectly unpacked as argument
--FILE--
<?php
$object = new class implements ArrayAccess {
public function offsetGet($offset)
{
return [1, 2];
}
public function offsetExists($offset)
{
return true;
}
public function offsetUnset($offset) {}
public function offsetSet($offset, $value) {}
};
var_dump(max(...$object[0]));
?>
--EXPECT--
int(2)

0 comments on commit bab8b3a

Please sign in to comment.