From afbc346926e2db1bfb50bd4cf5f5c57c69ea1c99 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 12 Apr 2016 13:40:25 +0200 Subject: Removing regex modifier deleted from PHP7 --- .../TextHighlighter/Text/Highlighter/Renderer/Console.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer') diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php index 88d13761..1f4ec071 100644 --- a/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php @@ -179,7 +179,13 @@ class Text_Highlighter_Renderer_Console extends Text_Highlighter_Renderer $nlines = substr_count($this->_output, "\n") + 1; $len = strlen($nlines); $i = 1; - $this->_output = preg_replace('~^~em', '" " . str_pad($i++, $len, " ", STR_PAD_LEFT) . ": "', $this->_output); + $this->_output = preg_replace_callback( + '~^~m', + function($matches) use(&$i, $len) { + return " " . str_pad($i++, $len, " ", STR_PAD_LEFT) . ": "; + }, + $this->_output + ); } $this->_output .= HL_CONSOLE_DEFCOLOR . "\n"; } -- cgit v1.2.3