Closed char101 closed 6 years ago
Because in PHP $f()
call a closure from a variable, while f()
call a declared function.
It's exactly what happen if you try to execute this both codes in a PHP file. Except if you use the jsphpize (pug-php with JS expressionLanguage = 'js', or install the extension in Phug), we do not parse the code inside expressions/codes else. We generate PHP file and give it to PHP. There is no added value to catch and rewrite each PHP possible error.
Does this pose a problem to the use?
No, it is not a problem for me, I only thought that it could pose some confusion for some people. I realize now that pug does not have a function call syntax (other than mixin call) only PHP expression syntax. So whatever error in the expression comes from PHP.
Hello,
PHP Fatal error: Uncaught Error: Call to undefined function f()
PHP Fatal error: Uncaught Error: Function name must be a string