php 5.2中的get_called_class *

Recently I have completed a web project where php version is 5.3, then I upload this into a server where php version is 5.2.*. Then the following message is shown:

Fatal error: Class name must be a valid object or a string in /home/user_folder/public_html/_includes/class.myclass.php on line 264

In my class.myclass.php I use the following code ::

protected function get_table_value($record)  {
  $className = get_called_class();   //

  $object = new $className; // line 264
  // rest of the code
}

then I change this code as following ::

// get the database table's column's value
    protected function get_table_value($record)  {
       $className = $this->generate_class_name();
       $object = new $className;   // same error in this line

       // rest of code
    }

     private function generate_class_name()   {

        if ( !function_exists('get_called_class') ) {
           $bt = debug_backtrace();
           $l = count($bt) - 1;
           $matches = array();
           while(empty($matches) && $l > -1){
              $lines = file($bt[$l]['file']);
              $callerLine = $lines[$bt[$l]['line']-1];
              preg_match('/([a-zA-Z0-9\_]+)::'.$bt[$l--]['function'].'/',
              $callerLine,
              $matches);
            }
            if (!isset($matches[1])) $matches[1]=NULL; //for notices
              if ($matches[1] == 'self') {
              $line = $bt[$l]['line']-1;
              while ($line > 0 && strpos($lines[$line], 'class') === false) {
                 $line--;
             }
             preg_match('/class[\s]+(.+?)[\s]+/si', $lines[$line], $matches);
           }
         return $matches[1];               
        }   
        else {                
            return get_called_class();
        }            
    }

And now again that error msg come. any solution.

Your question is unclear. The following is an extract from the manual: Get_Class(); Which will input your current class into a return statement of as a var (see fig2):

Fig 1

class foo {
    function name()
    {
        echo "My name is " , get_class($this) , "
";
    }
}

// create an object
$bar = new foo();

// external call
echo "Its name is " , get_class($bar) , "
";

// internal call
$bar->name();

Fig 2

class foo{
  public function Test(){
    $Classname = get_class($this);
    $Instance = new $Classname;
    return $Classname;
  }
}

Perhaps modify your function to follow this procedure.