xref: /PHP-8.3/Zend/tests/bug78356.phpt (revision 75a678a7)
1--TEST--
2Bug #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};
17var_dump(max(...$object[0]));
18?>
19--EXPECT--
20int(2)
21