PHP Top-level class _php tutorial

Source: Internet
Author: User
/**
* Object
* Base class
*/
Class Object
{
/* Whether to output debug information */
var $debug = true;

/**
* Object
* @deprecated Destruction method
*
* @return void
*/
function Object ()
{
Whether the user enters from the homepage, makes a decision
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 setting whether to output debug information
* @param Boolean True or False
* @return void
*/
function Setdebug ($bool)
{
$this->debug = Is_bool ($bool)? $bool: false;
}

/**
* Getdebug * @deprecated to see if debugging information is turned on
* @param void
* @return Boolean
*/
function Getdebug ()
{
return $this->debug;
}
}
?>

http://www.bkjia.com/PHPjc/631974.html www.bkjia.com true http://www.bkjia.com/PHPjc/631974.html techarticle PHP/** * Object * Base class */Class Object {/* Whether to output debug information */var $debug = true;/** * Object * @deprecated destructor method * * @return void */function Object () {/...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.