开发者

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

开发者 https://www.devze.com 2023-01-17 11:34 出处:网络
I have an __autoload function defined for load classes automatically, if that file has a syntax error, the script stops, simply stops... without error...

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

精彩评论

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