run code in 200+ php & hhvm versions
Bugs & Features
<?php    class Animal {     public static $name = "animal";        // Return the class that is represented by "self::"     public function getSelfClass()     {         return get_class();     }        // Return the class that is represented by "static::"     public function getStaticClass()     {         return get_called_class();     }        public function selfVar()     {         return self::$name;     }        public function staticVar()     {         return static::$name;     }        public function selfMethod()     {         return self::getName();     }        public function staticMethod()     {         return static::getName();     }        protected function getName()     {         return "animal";     }    }    class Penguin extends Animal {     public static $name = "penguin";        protected function getName()     {         return "penguin";     } }    var_dump('selfVar'.Penguin::selfVar()); var_dump('staticVar'.Penguin::staticVar()); var_dump('selfMethod'.Penguin::selfMethod()); var_dump('staticMethod'.Penguin::staticMethod()); var_dump('getSelfClass'.Penguin::getSelfClass()); var_dump('getStaticClass'.Penguin::getStaticClass());

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page