开发者

If the file in __autoload has a Syntax Error, then the script stops without show a message

I have an __autoload function defined for load classes automatically, if that file has a syntax error, the script stops, simply stops... without error...

function __autoload开发者_开发技巧( $var_class )
{
    require_once( "$var_class.php" );
}
echo "Before load...";
new ClassName();
echo "Hello world...";

Output:

Before load...

How to show de SYNTAX ERROR?


Shows the error for me:

class ClassName
{
    public function __construct()
    {
        $line = $error
        echo 'Contructor' . "\n";
    }
}

Output:

Before load...
Parse error: syntax error, unexpected T_ECHO in ClassName.php on line 8

See Fanis' comment.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜