3v4l.org

run code in 300+ PHP versions simultaneously
<?php $something = [3, 2, 1, 3, 6, 5, 1, 1]; $liste = []; foreach ($something as $value) { $found[$value] ??= $liste[] = $value; } var_export($liste);
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array ( 0 => 3, 1 => 2, 2 => 1, 3 => 6, 4 => 5, )

preferences:
52.57 ms | 849 KiB | 4 Q