phamlp icon indicating copy to clipboard operation
phamlp copied to clipboard

Bug in SassScriptLexer.php in PHP 7: substr() now returns empty string instead of false.

Open dfletcher opened this issue 8 years ago • 0 comments

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.

dfletcher avatar Nov 08 '17 19:11 dfletcher