I have a script that runs on the command line and does some mysql database processing (select data from one table, make some calculations and insert/update a different table). After some 10000 iterations, I repeatably get the following error:
DBALStatement::removeColons(): send of 5 bytes failed with errno=32 Broken pipe
This is the method in question:
public static function removeColons($params) : array
{
$result = [];
foreach ($params as $key => $val) {
if ($key[0] == ':') {
$key = substr($key, 1);
}
$result[$key] = $val;
}
return $result;
}
The line in which the error happens is the return statement:
return $result;
I understand that broken pipes can happen when doing network or file operations or something, but how can I get this error on a simple return statement with no pipe anywhere near? What am I missing?
Edit: It seems that the broken pipe actually happens during the mysql query, which would make at bit more sense. I am currently still trying to figure out if this is a timeout problem or what. However, it is important to note that the method and line number reported in the PHP error log appear to be wrong in this instance, since the error clearly does not happen in the return statement. I would consider this a bug in the PHP error reporting.