Bug #71179 [Com]: memory limit exhausted when running scss parser from richthegeek
[email protected] ("am05mhz at live dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=71179&edit=1
ID: 71179
Comment by: am05mhz at live dot com
Reported by: am05mhz at live dot com
Summary: memory limit exhausted when running scss parser from
richthegeek
Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: windows
PHP Version: 7.0.1
Block user comment: N
Private report: N
New Comment:
well now, this is embarrassing, i only checked the function reference, and then check you bug report on phpsass after commenting. sorry for that.
but the missing documentation part is still true
thank you very much
Previous Comments:
------------------------------------------------------------------------
[2015-12-21 16:31:23] am05mhz at live dot com
hi laurence, thanks for responding,
though i did not consult substr function reference, i did consult the php 7 backward compatibility manual.
in that case, i have to report for documentation error, as the changes in substr behavior is not yet documented in the backward incompatible changes, and i failed to see why the change in behavior resulted in memory limit exhausted, as "" is equal to false under loose comparison, but thanks anyway, now i can try do fix something :D
http://php.net/manual/en/migration70.incompatible.php
------------------------------------------------------------------------
[2015-12-21 13:47:12] [email protected]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
this is due to now:
substr("", 0) will return "" instead of false: http://php.net/manual/en/function.substr.php
I have create an issue in phpsass, hope they will fix it soon, thanks
https://github.com/richthegeek/phpsass/issues/179
------------------------------------------------------------------------
[2015-12-21 11:08:08] am05mhz at live dot com
Description:
------------
memory limit exhausted when using win 10 with PHP 7.0.1 VC14 x64 Thread Safe (2015-Dec-17 00:17:17)
no matter how high I set my memory limit, it will get exhausted, and it only happen when running the php scss parser from richthegeek, sample code provided below.
memory limit I have tried: 128MB, 256MB, 512MB
this does not happen in PHP 5.6 VC11 x64 Thread Safe (2015-Nov-26 04:33:59)
with memory limit 128MB and other supported settings the same (obviously excluding mysql extension)
changes to php.ini:
include_path = ".;S:\php\PEAR"
memory_limit = 512MB
Test script:
---------------
this error only happen when using scss parser from richthegeek
https://github.com/richthegeek/phpsass
require 'SassParser.php';
$options = array(
'style' => 'nested',
'cache' => false,
'syntax' => 'scss',
'debug' => false,
);
$parser = new SassParser($options);
$css = $parser->toCss($some_big_scss_file);
//note my scss file have around 1000 lines
Expected result:
----------------
scss code should be successfully parsed regardless if there is error in the scss (as like the behavior in php 5.6)
Actual result:
--------------
php stopped the execution with memory limit exhausted
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 134217736 bytes) in some_path\libraries\script\SassScriptLexer.php on line 118
A PHP Error was encountered
Severity: Error
Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 134217736 bytes)
Filename: script/SassScriptLexer.php
Line Number: 118
Backtrace:
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71179&edit=1