- get_class: documentation ( source)
<?php
namespace LOLOL;
abstract class Abs {
public function __toString()
{
return get_class($this);
/* Should print test, not abs :P */
}
}
class Test extends Abs
{
}
$x = new Test;
echo $x;