protected compileOpenings ( string $value ) : string | ||
$value | string | |
return | string |
protected function compileOpenings($value)
{
$pattern = '/(?(R)\\((?:[^\\(\\)]|(?R))*\\)|(?<!\\w)(\\s*)@(if|elseif|foreach|for|while)(\\s*(?R)+))/';
return preg_replace($pattern, '$1<?php $2$3: ?>', $value);
}