I have an object with a protected property _errors set to an empty array. The rest of the properties are numeric indexes as such:
["_errors:protected"] => array(0){}
["0"] => string(34) "stuff..."
["1"] => string(34) "things..."
When I cast it to an array with (array)$object, it becomes:
["*_errors"] => array(0){}
[0] => string(34) "stuff..."
[1] => string(34) "things..."
When I loop through the array with foreach, my apache access logs show a 303, and Chrome shows ERR_EMPTY_RESPONSE.
foreach ($array as $item) {...}
My coworker has the exact same code, but the page loads fine. I'm on php 7.2.19 and he's on php 7.2.18. It's a Joomla administrator page in a custom component. I have narrowed down that the 303 error is only occurring when I loop through the casted array. Commenting out the line loads the page as normal. Looping through the original object does not cause the error ether.
Does anyone know what could be causing this?