Fix ArrayIterator interface implementation; remove usage of arraysize(), structsize...
[plcapi.git] / demo / client / agesort.php
index 7f870c6..b21bf89 100644 (file)
@@ -49,9 +49,7 @@ $resp = $client->send($req);
 if (!$resp->faultCode()) {
     print "The server gave me these results:<pre>";
     $value = $resp->value();
-    $max = $value->arraysize();
-    for ($i = 0; $i < $max; $i++) {
-        $struct = $value->arraymem($i);
+    foreach ($value as $struct) {
         $name = $struct->structmem("name");
         $age = $struct->structmem("age");
         print htmlspecialchars($name->scalarval()) . ", " . htmlspecialchars($age->scalarval()) . "\n";