以下代码有什么问题?
当我试图运行linter时,它给了我:
# PHP Parse error: syntax error, unexpected '}' in test.ph on line 19
<?php
function foo()
{
return function()
{
print 'bar';
}
}
Run Code Online (Sandbox Code Playgroud)
// correct syntax
return EXPRESION;
// your function
function foo()
{
return function()
{
print 'bar';
}; // You need to add a semicolon.
}
Run Code Online (Sandbox Code Playgroud)