_Error or New Feature?_
I use code in blade:
{{ $article->title or ' ' }}
[5.6] -> framework/src/Illuminate/View/Compilers/Concerns/CompilesEchos.php
public function compileEchoDefaults($value)
{
return preg_replace('/^(?=\$)(.+?)(?:\s+or\s+)(.+?)$/si', 'isset($1) ? $1 : $2', $value);
}
From ver 5.7 code block was removed.
Because you can use ?? in PHP7.
{{ $article->title ?? ' ' }}
OK, Now all the code requires an update.
Plus there are many edge cases with "or" that you don't have to deal with when using "??".
@dka-develop yes, but your app will be faster because this code will be executed on lower level.
@antonkomarev You Right!
but modifying the code is too cumbersome ..... T.T
@Yi-Frank Don't upgrade then.