3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = [ 'a' => 2, 'b' => 1, 'c' => 1, 'd' => 3 ]; $lowestValue = min($users); $lowestValueKeys = array_keys($users, $lowestValue); print_r($lowestValueKeys); $lowestUsers = array_intersect_key($users, array_flip($lowestValueKeys)); print_r($lowestUsers); $lowestValue = min($users); $lowestUsers = array_filter($users, function ($v) use ($lowestValue) { return $v === $lowestValue; }); print_r($lowestUsers);
Output for 7.1.25 - 7.1.28, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Array ( [0] => b [1] => c ) Array ( [b] => 1 [c] => 1 ) Array ( [b] => 1 [c] => 1 )

preferences:
159.7 ms | 403 KiB | 166 Q