3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Aareon_Abstract { public static $instance; public static function getInstance() { if (self::$instance === null) { self::$instance = new static(); } return self::$instance; } } class Aareon_MaterializedView extends Aareon_Abstract { public static $instance; } class Sample extends Aareon_Abstract { } echo get_class(Aareon_Abstract::getInstance()) . PHP_EOL; echo get_class(Aareon_MaterializedView::getInstance()) . PHP_EOL; //As you can see, a new B is instantiated here, because B::$instance is a priority over A::$instance. echo get_class(Aareon_Abstract::getInstance()) . PHP_EOL; A::$instance = null; echo PHP_EOL; echo get_class(Aareon_Abstract::getInstance()) . PHP_EOL; echo get_class(Sample::getInstance()) . PHP_EOL; //But here, there is no C::$instance, so let's check the A::$instance which is not empty. echo get_class(Aareon_Abstract::getInstance()) . PHP_EOL;
based on sGQGS

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)
7.3.00.0130.00316.31
7.2.130.0140.01116.73
7.2.120.0090.00917.09
7.2.110.0110.01117.05
7.2.100.0140.00316.95
7.2.90.0080.00416.70
7.2.80.0070.01116.79
7.2.70.0090.00916.82
7.2.60.0110.00616.93
7.2.50.0070.00716.67
7.2.40.0120.00616.88
7.2.30.0120.00916.91
7.2.20.0110.00716.66
7.2.10.0130.00716.84
7.2.00.0080.00618.07
7.1.250.0130.01015.66
7.1.240.0110.00415.38
7.1.230.0090.00615.46
7.1.220.0060.01015.88
7.1.210.0180.00015.47
7.1.200.0120.00115.62
7.1.190.0130.00315.50
7.1.180.0100.00715.72
7.1.170.0110.00415.71
7.1.160.0160.00015.77
7.1.150.0070.00715.50
7.1.140.0120.00315.62
7.1.130.0130.00315.86
7.1.120.0120.00415.58
7.1.110.0130.00615.84
7.1.100.0050.01016.85
7.1.90.0130.00715.61
7.1.80.0140.00315.69
7.1.70.0040.00816.42
7.1.60.0100.01017.42
7.1.50.0050.01416.12
7.1.40.0030.00615.44
7.1.30.0130.00615.41
7.1.20.0040.01115.37
7.1.10.0100.00615.77
7.1.00.0050.03918.84
7.0.330.0080.00415.07
7.0.320.0130.00315.54
7.0.310.0100.00715.39
7.0.300.0070.00715.20
7.0.290.0100.00715.05
7.0.280.0000.01415.25
7.0.270.0100.00715.21
7.0.260.0100.00515.23
7.0.250.0120.00315.41
7.0.240.0120.00615.32
7.0.230.0130.00715.46
7.0.220.0110.00315.25
7.0.210.0030.01015.49
7.0.200.0030.00815.76
7.0.190.0080.00814.93
7.0.180.0100.01015.47
7.0.170.0080.00815.12
7.0.160.0030.01315.24
7.0.150.0100.01015.17
7.0.140.0090.00615.46
7.0.130.0070.00715.22
7.0.120.0070.01515.58
7.0.110.0120.00615.37
7.0.100.0080.00715.45
7.0.90.0080.01215.48
7.0.80.0070.01014.96
7.0.70.0120.00015.04
7.0.60.0080.03817.52
7.0.50.0080.04316.54
7.0.40.0080.04316.83
7.0.30.0170.02316.72
7.0.20.0200.02916.82
7.0.10.0030.04716.69
7.0.00.0030.02416.83
5.6.380.0070.00714.34
5.6.370.0130.00813.97
5.6.360.0000.01514.00
5.6.350.0030.01013.96
5.6.340.0060.00614.13
5.6.330.0080.00814.25
5.6.320.0140.00314.61
5.6.310.0060.00613.92
5.6.300.0110.00414.44
5.6.290.0030.01014.25
5.6.280.0050.04017.71
5.6.270.0070.00714.53
5.6.260.0030.00914.67
5.6.250.0110.00414.14
5.6.240.0030.01014.28
5.6.230.0050.01114.54
5.6.220.0100.00314.24
5.6.210.0120.03517.59
5.6.200.0100.03116.27
5.6.190.0070.03217.46
5.6.180.0190.02717.49
5.6.170.0080.02917.23
5.6.160.0120.03717.43
5.6.150.0100.02716.23
5.6.140.0070.03716.33
5.6.130.0050.04616.29
5.6.120.0170.03317.71
5.6.110.0070.04317.74
5.6.100.0060.04617.66
5.6.90.0040.05117.51
5.6.80.0070.04417.23
5.6.70.0090.00914.53
5.6.60.0070.00714.16
5.6.50.0060.00914.30
5.6.40.0000.01214.13
5.6.30.0040.00814.13
5.6.20.0070.00714.15
5.6.10.0070.00514.13
5.6.00.0060.00314.33
5.5.380.0000.00711.27
5.5.370.0030.00611.35
5.5.360.0090.00311.44
5.5.350.0050.03015.88
5.5.340.0090.02014.58
5.5.330.0080.01815.76
5.5.320.0130.02215.89
5.5.310.0150.02815.78
5.5.300.0030.04514.56
5.5.290.0070.03714.69
5.5.280.0020.02416.06
5.5.270.0050.04515.99
5.5.260.0050.04615.98
5.5.250.0080.04315.96
5.5.240.0070.03515.73
5.5.230.0060.00611.18
5.5.220.0000.01111.18
5.5.210.0060.00611.18
5.5.200.0000.00711.18
5.5.190.0050.00311.18
5.5.180.0000.01011.22
5.5.170.0030.00311.18
5.5.160.0060.00611.18
5.5.150.0040.00711.34
5.5.140.0030.00611.18
5.5.130.0020.00511.18
5.5.120.0040.00811.18
5.5.110.0000.01211.18
5.5.100.0040.00411.18
5.5.90.0040.00811.18
5.5.80.0040.00411.18
5.5.70.0060.00011.26
5.5.60.0050.00511.29
5.5.50.0060.00311.29
5.5.40.0030.00611.18
5.5.30.0040.00411.18
5.5.20.0070.00311.20
5.5.10.0070.00411.18
5.5.00.0060.00611.25
5.4.450.0340.03415.18
5.4.440.0370.03015.31
5.4.430.0380.03015.28
5.4.420.0420.02315.30
5.4.410.0420.03515.34
5.4.400.0470.02815.12
5.4.390.0420.04315.14
5.4.380.0390.02715.22
5.4.370.0390.02615.13
5.4.360.0440.02715.13
5.4.350.0500.02515.13
5.4.340.0400.02815.10
5.4.330.0070.00511.18
5.4.320.0370.03015.13
5.4.310.0420.02315.19
5.4.300.0390.02615.01
5.4.290.0340.03215.12
5.4.280.0370.03215.05
5.4.270.0390.02815.02
5.4.260.0410.03115.09
5.4.250.0340.03215.11
5.4.240.0370.03215.10
5.4.230.0360.03015.21
5.4.220.0370.03015.19
5.4.210.0380.02815.12
5.4.200.0550.03315.05
5.4.190.0530.02715.18
5.4.180.0510.03015.05
5.4.170.0460.03115.13
5.4.160.0500.02915.08
5.4.150.0510.03515.18
5.4.140.0360.02913.85
5.4.130.0360.02413.79
5.4.120.0370.02713.81
5.4.110.0370.02713.91
5.4.100.0380.03113.90
5.4.90.0300.03113.75
5.4.80.0350.02713.74
5.4.70.0150.03213.89
5.4.60.0070.02513.76
5.4.50.0020.01913.84
5.4.40.0120.01713.86
5.4.30.0150.01713.80
5.4.20.0160.03613.87
5.4.10.0030.00911.18
5.4.00.0030.00711.18
5.3.290.3870.03714.63
5.3.280.3900.03314.60
5.3.270.4000.04714.63
5.3.260.3370.03714.83
5.3.250.0130.04014.77
5.3.240.2500.04014.53
5.3.230.0270.05714.59
5.3.220.0270.03314.71
5.3.210.0200.08014.72
5.3.200.0300.06714.57
5.3.190.3300.03714.79
5.3.180.0300.05714.48