PHP: How to print a name of a class?

The following code helps identifying the name of the class with the usage of PHP constant __CLASS__

class myClass{

    function __construct(){
        echo "You are now inside class = ".__CLASS__;


Written by kurinchilamp

Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *