@ 2019-06-20T10:20:40Z <?php
$array = [0, 1, 2, 3];
unset($array[3], $array[2]);
$arrayCopy = $array;
$arrayCopy[] = 2;
assert($arrayCopy === [0, 1, 2]); // this assertion must pass; it doesn't currently
$array[] = 2;
assert($array === $arrayCopy); // still identical/equal
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.33 , 8.2.0 - 8.2.29 , 8.3.0 - 8.3.25 , 8.4.1 - 8.4.12 Fatal error: Uncaught AssertionError: assert($arrayCopy === [0, 1, 2]) in /in/vDj4c:9
Stack trace:
#0 /in/vDj4c(9): assert(false, 'assert($arrayCo...')
#1 {main}
thrown in /in/vDj4c on line 9
Process exited with code 255 . Output for 7.1.25 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 Warning: assert(): assert($arrayCopy === [0, 1, 2]) failed in /in/vDj4c on line 9
preferences:dark mode live preview ace vim emacs key bindings
143.79 ms | 408 KiB | 5 Q