Replaced !$sharedString by $sharedString === null to avoid the case when $sharedString = ''
Escaped line feed characters in shared strings before processing them. This makes every string remain on one single line and therefore allow fast retrieval Replaced usages of "\n" by PHP_EOL Added test for multiline strings