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

Method _pack_object

php5/JSONH.class.php:95–117  ·  view source on GitHub ↗
(
        /*object /*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

93 }
94
95 private static function _pack_object(
96 /*object /*use type hint if you can removing initial comment*/
97 $list,
98 /*int /*use type hint if you can removing initial comment*/
99 $length
100 ) {
101 for (
102 $keys = self::_getKeys($list[0]),
103 $klength = count($keys),
104 $result = array(),
105 $i = 0,
106 $j = 0,
107 $ki, $o;
108 $i < $length; ++$i
109 ) {
110 for (
111 $o = $list[$i], $ki = 0;
112 $ki < $klength;
113 $result[$j++] = $o->$keys[$ki++]
114 );
115 }
116 return array_merge(array($klength), $keys, $result);
117 }
118
119 private static function _unpack_array(
120 /*array /*use type hint if you can removing initial comment*/

Callers 1

packMethod · 0.95

Calls 1

_getKeysMethod · 0.95

Tested by

no test coverage detected