I Just find a bug in PHP when you are reusing variables by references.

This is the example code:

$lines = array(
	'1' => array(
	'2' => array(

foreach($lines as &$items){
	foreach($items as $key => $value){
		if($value=='2B') unset($items[$key]);

$items = array();
foreach($lines as $key => $items){

What this code should do, is to take the $lines array and delete the 2B value, but it doesn’t work like that, and is because it get crash when you use the $items variable in the second foreach and you already used it as a referece variable, even if you clean the $items variable with an empty array as you see in the code.

Just if you change the name or the $items variable in the second foreach it works fine.