xref: /PHP-8.0/Zend/tests/bug73663_2.phpt (revision 9975986b)
1--TEST--
2Bug #73663.2 ("Invalid opcode 65/16/8" occurs with a variable created with list())
3--FILE--
4<?php
5function change(&$ref) {
6    $ref = range(1, 10);
7    return;
8}
9
10$array = [1];
11change(list($val) = $array);
12var_dump($array);
13?>
14--EXPECTF--
15Fatal error: Uncaught Error: change(): Argument #1 ($ref) cannot be passed by reference in %s:%d
16Stack trace:
17#0 {main}
18  thrown in %s on line %d
19