xref: /PHP-8.4/Zend/tests/array_unshift_COW.phpt (revision f8d79582)
1--TEST--
2Tests that array unshift code is correctly dealing with copy on write and splitting on reference
3--FILE--
4<?php
5    $a=array();
6    $b=1;
7    $c=&$b;
8    array_unshift ($a,$b);
9    $b=2;
10    var_dump ($a);
11?>
12--EXPECT--
13array(1) {
14  [0]=>
15  int(1)
16}
17