PHP top-level class .? Php *** Object ** baseclass * classObject {* Whether to output debugging information * var $ debugtrue; *** Object * @ deprecated destructor ** @ returnvoid * functionObject (){ /**
* Object
* Base class
*/
Class Object
{
/* Whether to output debugging information */
Var $ debug = true;
/**
* Object
* @ Deprecated destructor
*
* @ Return void
*/
Function Object ()
{
// Determine whether the user is on the homepage
If (! Defined ('index '))
{
Die ("Hacking attempt ");
}
// Echo 'create Object success! ';
}
/**
* Msg_die
* @ Deprecated debug information output
* @ Param string
* @ Return void
*/
Function msg_die ($ info, $ file, $ line)
{
If ($ this-> debug)
{
$ Format = "There is happen error information: % s .".
"The file name: % s, on line: % s .";
Printf ($ format, $ info, $ file, $ line );
$ Error = debug_backtrace ();
Print_r ($ error [0]);
}
}
/**
* SetDebug
* @ Deprecated: Sets whether to output debugging information.
* @ Param boolean true or false
* @ Return void
*/
Function setDebug ($ bool)
{
$ This-> debug = is_bool ($ bool )? $ Bool: false;
}
/**
* GetDebug * @ deprecated check whether debugging information is enabled
* @ Param void
* @ Return boolean
*/
Function getDebug ()
{
Return $ this-> debug;
}
}
?>
Http://www.bkjia.com/PHPjc/631974.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631974.htmlTechArticle? Php/*** Object * base class */class Object {/* Whether to output debugging information */var $ debug = true; /*** Object * @ deprecated destructor ** @ return void */function Object (){/...