<?php require_once '../includes/common.inc.php'; class TTime { var $FValue; // equal to public $FValue; private $FTime; const Fconstant = 'constant value 88'; public function __construct() { echo "__construct has been invoked."."<br>"; } public function __destruct() { echo "__destruct has been invoked."."<br>"; } function show_constant() { echo self::Fconstant."<br>"; //echo $this->Fconstant."<br>"; } public function set_time($time) { $this->FTime = $time; } public function get_time() { return $this->FTime; } public function set_value($value) { $this->FValue = $value; } public function get_value() { return $this->FValue; } public static function get_now() { return date('Y-m-d H:i:s'); } } $time = new TTime(); $time->FValue = 'test'; $value = $time->get_value(); echo $value."<br>"; $nowtime = TTime::get_now(); echo $nowtime."<br>"; $time->set_time(date('Y-m-d H:i:s')); $gettime = $time->get_time(); echo $gettime."<br>"; $time->show_constant(); echo "Current Time:".date("Y-m-d H:i:s",time())."<br>"; exit;