开发者

Php code not executing - dies out when trying to refer to member of static class - no error displayed

开发者 https://www.devze.com 2022-12-23 21:16 出处:网络
I\'m having some problems with this piece of code. I\'ve included a class declaration and trying to开发者_JS百科 create an object of that class but my code dies out. It doesn\'t seem to be an include

I'm having some problems with this piece of code. I've included a class declaration and trying to开发者_JS百科 create an object of that class but my code dies out. It doesn't seem to be an include issue as all the files are being included even the files called for inclusion within the class file itself.

However the object is not created - I tried to put an echo statement in the __construct function but nothing it just doesn't run infact doesn't create the object and the code won't continue from there - plus no error is reported or displayed and I have error reporting set to E_ALL and display errors set to true

WHats happening here :(

=============EDIT

SOrry I checked again the error is prior to teh object creation thing - it dies out when it tries to refer to a constant in a static class like so:

$v = Zend_Oauth::REQUEST_SCHEME_HEADER;

THis is the class or part of it - it has largely static functions its the Zend Oauth class:

class Zend_Oauth
{
    const REQUEST_SCHEME_HEADER      = 'header';
    const REQUEST_SCHEME_POSTBODY    = 'postbody';
    const REQUEST_SCHEME_QUERYSTRING = 'querystring'; // continued

LIke I said no error is being reported at all :(


If php really bails out on $v = Zend_Oauth::REQUEST_SCHEME_HEADER; then it's most likely a

PHP Fatal error:  Class 'Zend_Oauth' not found 

error. But that's something you would see with error_reporting(E_ALL);
Other than that there's nothing in that line of code that can cause a fatal error.

If you want to put some debug (output) code in there try something like

echo "<h1>Debug: A</h1>\n"; flush();
error_reporting(E_ALL); ini_set('display_errors', 1);
$v = Zend_Oauth::REQUEST_SCHEME_HEADER;
echo "<h1>Debug: B</h1>\n"; flush();
0

精彩评论

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