bug78356.phpt 471 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #78356: Array returned from ArrayAccess is incorrectly unpacked as argument
  3. --FILE--
  4. <?php
  5. $object = new class implements ArrayAccess {
  6. public function offsetGet($offset): mixed
  7. {
  8. return [1, 2];
  9. }
  10. public function offsetExists($offset): bool
  11. {
  12. return true;
  13. }
  14. public function offsetUnset($offset): void {}
  15. public function offsetSet($offset, $value): void {}
  16. };
  17. var_dump(max(...$object[0]));
  18. ?>
  19. --EXPECT--
  20. int(2)