phamlp
phamlp copied to clipboard
Bug in SassScriptLexer.php in PHP 7: substr() now returns empty string instead of false.
This file contains a loop checking if $string !== false. Because of this subtle change in PHP 7, the loop while statement evaluates as "" !== false which always returns true. The loop continues forever until PHP runs out of memory.
The simple fix is to replace the exact type check of !== with simply !=. Then when substr() returns an empty string, the comparison returns false and the loop breaks at the proper time.