Method
_unpack_object
(
/*array /*use type hint if you can removing initial comment*/
$hlist
)
Source from the content-addressed store, hash-verified
| 140 | } |
| 141 | |
| 142 | private static function _unpack_object( |
| 143 | /*array /*use type hint if you can removing initial comment*/ |
| 144 | $hlist |
| 145 | ) { |
| 146 | for ( |
| 147 | $length = count($hlist), |
| 148 | $klength = $hlist[0], |
| 149 | $result = array(), |
| 150 | $i = 1 + $klength, |
| 151 | $j = 0, |
| 152 | $ki, $o; |
| 153 | $i < $length; |
| 154 | ) { |
| 155 | for ( |
| 156 | $o = new StdClass, $ki = 0; |
| 157 | $ki < $klength; |
| 158 | $o->$hlist[++$ki] = $hlist[$i++] |
| 159 | ); |
| 160 | $result[$j++] = $o; |
| 161 | } |
| 162 | return $result; |
| 163 | } |
| 164 | |
| 165 | // simple helper |
| 166 | private static function _getKeys($object) { |
Tested by
no test coverage detected