3v4l.org

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());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
5.4.270.0130.07018.82
5.4.260.0170.06318.99
5.4.250.0230.05719.00
5.4.240.0130.06018.91
5.4.230.0030.07019.13
5.4.220.0100.05719.04
5.4.210.0170.06718.97
5.4.200.0100.06019.09
5.4.190.0100.06018.99
5.4.180.0100.05719.13
5.4.170.0070.07719.06
5.4.160.0070.06318.99
5.4.150.0030.07018.99
5.4.140.0130.05716.54
5.4.130.0170.05716.39
5.4.120.0070.05316.53
5.4.110.0070.06016.64
5.4.100.0100.07016.64
5.4.90.0200.04316.48
5.4.80.0100.07716.70
5.4.70.0300.05016.41
5.4.60.0100.07016.62
5.4.50.0100.06016.62
5.4.40.0100.06716.51
5.4.30.0130.04716.40
5.4.20.0070.06016.39
5.4.10.0030.06316.60
5.4.00.0070.05716.07
5.3.280.0130.06314.76
5.3.270.0070.06714.66
5.3.260.0130.05314.59
5.3.250.0200.04314.40
5.3.240.0130.07314.76
5.3.230.0100.07314.79
5.3.220.0130.07014.77
5.3.210.0070.05714.55
5.3.200.0030.05714.76
5.3.190.0070.06014.63
5.3.180.0170.06714.71
5.3.170.0130.05014.74
5.3.160.0200.04314.71
5.3.150.0030.08314.73
5.3.140.0030.08014.55
5.3.130.0170.04714.53
5.3.120.0130.05714.71
5.3.110.0130.07014.67
5.3.100.0030.05314.23
5.3.90.0200.06014.19
5.3.80.0070.06014.00
5.3.70.0030.07314.01
5.3.60.0070.05314.09
5.3.50.0100.05714.14
5.3.40.0230.05713.94
5.3.30.0030.05713.84
5.3.20.0030.08013.84
5.3.10.0170.06313.75
5.3.00.0170.05013.63