Jump to content

get_called_class alternative


Recommended Posts

I think this works:

	public function get_called_class(){
	if(function_exists('get_called_class')){
		return get_called_class();
	}
	$t = debug_backtrace(); $t = $t[0];
	if (isset($t['object']) && $t['object'] instanceof $t['class'])
		return get_class($t['object']);
	return false;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.