MCPcopy Create free account
hub / github.com/WebReflection/JSONH / _pack_array

Method _pack_array

php5/JSONH.class.php:71–93  ·  view source on GitHub ↗
(
        /*array /*use type hint if you can removing initial comment*/
        $list,
        /*int /*use type hint if you can removing initial comment*/
        $length
    )

Source from the content-addressed store, hash-verified

69 }
70
71 private static function _pack_array(
72 /*array /*use type hint if you can removing initial comment*/
73 $list,
74 /*int /*use type hint if you can removing initial comment*/
75 $length
76 ) {
77 for (
78 $keys = array_keys($list[0]),
79 $klength = count($keys),
80 $result = array(),
81 $i = 0,
82 $j = 0,
83 $ki, $o;
84 $i < $length; ++$i
85 ) {
86 for (
87 $o = $list[$i], $ki = 0;
88 $ki < $klength;
89 $result[$j++] = $o[$keys[$ki++]]
90 );
91 }
92 return array_merge(array($klength), $keys, $result);
93 }
94
95 private static function _pack_object(
96 /*object /*use type hint if you can removing initial comment*/

Callers 1

packMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected