Home > Backend Development > PHP Tutorial > PHP top-level classes_PHP tutorial

PHP top-level classes_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:58:59
Original
867 people have browsed it

/**
* Object
* base class
*/
class Object
{
/* Whether to output debugging information */
var $debug = true;

/**
*Object
* @deprecated destructor method
*
* @return void
*/
function Object()
{
//Determine whether the user enters from 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 Set 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 turned on
* @param void
* @return boolean
*/
function getDebug()
{
return $this->debug;
}
}
?>

www.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 method * * @return void*/ function Object() { /...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template