Bug #71179 [Opn->Nab]: memory limit exhausted when running scss parser from richthegeek

From: Date: Mon, 21 Dec 2015 13:47:13 +0000
Subject: Bug #71179 [Opn->Nab]: memory limit exhausted when running scss parser from richthegeek
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198094@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71179&edit=1 ID: 71179 Updated by: laruence@php.net Reported by: am05mhz at live dot com Summary: memory limit exhausted when running scss parser from richthegeek -Status: Open +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: 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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#198094) next »