Showing lines 10-26 of the code might help.

I found this on php.net...
<?php
$a = "1"; // $a is a string
$a[0] = "f"; // What about string offsets? What happens?
?>

Since php (for historical reasons) supports indexing into strings via offsets using the same syntax as array indexing, the example above leads to a problem: should $a become an array with its first element being "f", or should "f" become the first character of the string $a?

The current versions of php interpret the second assignment as a string offset identification, so $a becomes "f", the result of this automatic conversion however should be considered undefined.