1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php function get_cards() { $cards = array(); while(count($cards) < 5){ $card = rand(1,52); while(in_array($card, $cards)){ $card = rand(1,52); } $cards[] = $card; } return $cards; } $cards = get_cards(); var_dump(memory_get_peak_usage());
1
int(51048)