Commit c8855c4d authored by Zot's avatar Zot

preg_replace e modifier deprecated

parent 0de4666a
<?php
1;4205;0c<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Console renderer
......@@ -179,7 +179,9 @@ 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 () use (&$i, $len) {
return ' ' . str_pad($i++, $len, ' ', STR_PAD_LEFT) . ': ';
}, $this->_output);
}
$this->_output .= HL_CONSOLE_DEFCOLOR . "\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment