1--TEST-- 2array_keys() and array_values() w/ packed optimization 3--FILE-- 4<?php 5 6$x = [1,2,3]; 7unset($x[1]); 8 9$inputs = [ 10 [], 11 [1,2,3], 12 [0=>1, 1=>2, 2=>3], 13 [1=>1, 2=>2, 3=>3], 14 [0=>1, 2=>3], 15 $x, 16]; 17 18foreach ($inputs as $input) { 19 print_r(array_keys($input)); 20 print_r(array_values($input)); 21} 22?> 23--EXPECT-- 24Array 25( 26) 27Array 28( 29) 30Array 31( 32 [0] => 0 33 [1] => 1 34 [2] => 2 35) 36Array 37( 38 [0] => 1 39 [1] => 2 40 [2] => 3 41) 42Array 43( 44 [0] => 0 45 [1] => 1 46 [2] => 2 47) 48Array 49( 50 [0] => 1 51 [1] => 2 52 [2] => 3 53) 54Array 55( 56 [0] => 1 57 [1] => 2 58 [2] => 3 59) 60Array 61( 62 [0] => 1 63 [1] => 2 64 [2] => 3 65) 66Array 67( 68 [0] => 0 69 [1] => 2 70) 71Array 72( 73 [0] => 1 74 [1] => 3 75) 76Array 77( 78 [0] => 0 79 [1] => 2 80) 81Array 82( 83 [0] => 1 84 [1] => 3 85) 86