Need help with exception handling for arrayObject. I’m iterating through a series of objects but when the offset ends fatal exception occurs. The code is:
while ($c <= 10) {
$num = 1;
$b = $c-$num;
$object_to_iterate = $q[$b];
$obj = new ArrayObject ($object_to_iterate);
iterateObject($obj);
$c ++;
}
The error is:
Fatal error: Uncaught exception 'InvalidArgumentException'
Any help would be great.
OK I don’t know if this is the best way to do it but I used the following code:
It works through