3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { const CONSTANT = 'constant value'; function showConstant() { echo self::CONSTANT . "\n"; } } echo MyClass::CONSTANT . "\n"; $classname = "MyClass"; echo $classname::CONSTANT . "\n"; // As of PHP 5.3.0 class B { function __construct() { $this->myclass = new MyClass(); $this->myclass->showConstant(); echo $this->myclass::CONSTANT; // <--------- from PHP 7 on } } $b = new B ?>

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).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0110.00316.63
8.3.50.0090.00617.93
8.3.40.0090.00918.93
8.3.30.0100.00718.83
8.3.20.0000.00820.24
8.3.10.0040.00423.66
8.3.00.0050.00319.50
8.2.180.0100.01318.54
8.2.170.0210.00022.96
8.2.160.0100.00319.32
8.2.150.0090.00024.18
8.2.140.0030.00624.66
8.2.130.0060.00319.36
8.2.120.0080.00026.35
8.2.110.0070.00319.24
8.2.100.0090.00317.75
8.2.90.0040.00419.23
8.2.80.0000.00817.97
8.2.70.0060.00317.60
8.2.60.0080.00017.80
8.2.50.0000.00818.07
8.2.40.0000.00719.39
8.2.30.0000.00720.60
8.2.20.0030.00717.75
8.2.10.0030.00518.12
8.2.00.0000.00717.99
8.1.280.0150.00325.92
8.1.270.0060.00323.92
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0090.00022.73
8.1.230.0060.00617.42
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0050.00317.13
8.1.180.0080.00018.10
8.1.170.0040.00418.57
8.1.160.0040.00422.01
8.1.150.0000.00718.88
8.1.140.0000.00819.48
8.1.130.0030.00317.73
8.1.120.0000.00717.36
8.1.110.0050.00317.36
8.1.100.0000.00817.49
8.1.90.0080.00017.45
8.1.80.0040.00417.45
8.1.70.0000.00717.30
8.1.60.0070.00017.46
8.1.50.0050.00317.52
8.1.40.0000.00817.46
8.1.30.0040.00417.54
8.1.20.0070.00017.67
8.1.10.0030.00617.54
8.1.00.0040.00417.53
8.0.300.0070.00018.77
8.0.290.0020.00516.75
8.0.280.0000.00718.43
8.0.270.0000.00717.25
8.0.260.0040.00417.17
8.0.250.0030.00316.85
8.0.240.0060.00316.82
8.0.230.0000.00716.88
8.0.220.0100.00016.88
8.0.210.0000.00716.76
8.0.200.0060.00016.81
8.0.190.0040.00416.92
8.0.180.0030.00616.85
8.0.170.0080.00016.83
8.0.160.0040.00416.79
8.0.150.0070.00016.81
8.0.140.0030.00316.88
8.0.130.0060.00313.35
8.0.120.0040.00416.79
8.0.110.0040.00416.84
8.0.100.0040.00416.88
8.0.90.0000.00716.80
8.0.80.0040.01216.89
8.0.70.0100.00016.71
8.0.60.0040.00416.95
8.0.50.0040.00416.76
8.0.30.0130.00617.00
8.0.20.0130.00517.40
8.0.10.0070.00016.96
8.0.00.0070.01116.89
7.4.330.0050.00016.73
7.4.320.0030.00316.43
7.4.300.0000.00616.45
7.4.290.0070.00016.43
7.4.280.0000.00716.52
7.4.270.0000.00616.60
7.4.260.0030.00416.56
7.4.250.0040.00416.39
7.4.240.0020.00616.57
7.4.230.0030.00316.40
7.4.220.0190.01016.35
7.4.210.0030.01216.60
7.4.200.0000.00716.30
7.4.160.0110.00816.51
7.4.150.0090.00917.40
7.4.140.0080.01317.86
7.4.130.0110.00616.60
7.4.120.0150.00816.61
7.4.110.0110.00816.50
7.4.100.0100.00716.44
7.4.90.0140.00816.57
7.4.80.0140.00319.39
7.4.70.0040.01416.56
7.4.60.0060.01016.50
7.4.50.0080.00616.48
7.4.40.0030.01416.59
7.4.30.0090.00916.52
7.4.10.0060.01015.28
7.4.00.0100.00815.17
7.3.330.0000.00513.34
7.3.320.0030.00313.34
7.3.310.0030.00416.13
7.3.300.0000.00616.37
7.3.290.0060.00816.33
7.3.280.0080.00816.35
7.3.270.0040.01317.40
7.3.260.0100.00716.55
7.3.250.0120.00716.43
7.3.240.0120.00716.48
7.3.230.0110.00616.59
7.3.210.0080.00816.63
7.3.200.0060.01316.53
7.3.190.0110.00916.61
7.3.180.0130.00316.76
7.3.170.0160.00316.53
7.3.160.0040.01116.47
7.3.130.0080.01015.22
7.3.120.0070.00915.23
7.3.110.0060.00915.21
7.3.100.0080.00615.18
7.3.90.0070.00915.25
7.3.80.0060.00815.31
7.3.70.0040.01115.27
7.3.60.0060.00815.19
7.3.50.0060.00815.24
7.3.40.0030.00815.22
7.3.30.0060.00815.22
7.3.20.0080.00417.09
7.3.10.0040.01016.97
7.3.00.0070.00617.04
7.2.330.0090.00916.39
7.2.320.0180.00616.69
7.2.310.0100.01016.91
7.2.300.0170.01016.71
7.2.290.0110.00716.74
7.2.260.0080.01115.30
7.2.250.0060.01115.57
7.2.240.0050.01115.47
7.2.230.0050.01015.52
7.2.220.0070.00915.45
7.2.210.0030.01115.58
7.2.200.0070.00715.46
7.2.190.0050.00815.36
7.2.180.0050.01115.26
7.2.170.0030.01115.36
7.2.160.0050.01115.43
7.2.150.0070.00617.28
7.2.140.0090.00517.31
7.2.130.0050.00917.23
7.2.120.0090.00617.27
7.2.110.0070.00717.31
7.2.100.0070.00717.20
7.2.90.0060.00917.36
7.2.80.0100.00617.47
7.2.70.0070.00417.33
7.2.60.0040.01017.16
7.2.50.0030.01017.24
7.2.40.0040.00917.37
7.2.30.0060.00717.35
7.2.20.0030.01117.17
7.2.10.0070.00717.29
7.2.00.0050.00917.62
7.1.330.0050.00816.22
7.1.320.0060.00916.26
7.1.310.0000.01116.09
7.1.300.0050.01016.02
7.1.290.0060.00716.17
7.1.280.0040.00916.19
7.1.270.0020.01316.07
7.1.260.0050.00616.18
7.1.250.0070.00615.95
7.1.240.0020.01016.16
7.1.230.0060.00516.11
7.1.220.0030.01116.20
7.1.210.0070.00616.06
7.1.200.0060.00715.99
7.1.190.0080.00716.20
7.1.180.0050.00716.15
7.1.170.0050.00816.13
7.1.160.0050.00816.14
7.1.150.0060.00716.02
7.1.140.0050.00616.17
7.1.130.0070.00716.19
7.1.120.0050.00716.13
7.1.110.0070.00816.18
7.1.100.0050.00816.45
7.1.90.0070.00616.11
7.1.80.0030.01016.22
7.1.70.0040.00916.39
7.1.60.0070.00816.78
7.1.50.0040.01016.35
7.1.40.0090.00416.09
7.1.30.0050.00616.20
7.1.20.0050.00716.15
7.1.10.0030.01016.11
7.1.00.0040.02317.38
7.0.330.0050.00815.68
7.0.320.0030.00615.72
7.0.310.0060.00515.87
7.0.300.0050.00815.80
7.0.290.0060.00415.82
7.0.280.0060.00915.82
7.0.270.0080.00515.80
7.0.260.0030.01115.84
7.0.250.0080.00715.77
7.0.240.0050.00715.90
7.0.230.0060.00515.81
7.0.220.0030.00915.81
7.0.210.0070.00715.80
7.0.200.0060.00715.96
7.0.190.0040.00915.88
7.0.180.0070.00415.79
7.0.170.0060.00515.76
7.0.160.0070.00515.73
7.0.150.0030.00915.81
7.0.140.0080.00415.85
7.0.130.0070.00715.77
7.0.120.0030.01016.00
7.0.110.0060.00615.73
7.0.100.0060.00815.83
7.0.90.0040.01015.90
7.0.80.0070.00615.83
7.0.70.0060.00615.86
7.0.60.0050.02317.02
7.0.50.0030.01916.20
7.0.40.0050.01815.14
7.0.30.0080.01415.05
7.0.20.0090.02015.12
7.0.10.0050.02215.08
7.0.00.0050.01315.15
5.6.400.0070.00614.68
5.6.390.0060.00614.65
5.6.380.0030.01114.58
5.6.370.0070.00714.58
5.6.360.0050.00914.66
5.6.350.0050.00714.47
5.6.340.0030.01014.67
5.6.330.0050.00814.53
5.6.320.0060.01014.65
5.6.310.0040.01014.42
5.6.300.0030.01114.62
5.6.290.0070.00814.55
5.6.280.0060.01615.76
5.6.270.0040.00814.42
5.6.260.0060.00814.58
5.6.250.0050.00914.49
5.6.240.0060.01014.50
5.6.230.0040.00814.52
5.6.220.0040.01014.63
5.6.210.0060.02315.76
5.6.200.0090.01415.26
5.6.190.0060.02315.79
5.6.180.0160.01715.69
5.6.170.0070.02515.54
5.6.160.0060.01915.71
5.6.150.0060.01415.25
5.6.140.0070.01415.26
5.6.130.0050.01715.32
5.6.120.0090.01015.77
5.6.110.0090.02015.79
5.6.100.0050.02315.84
5.6.90.0090.02015.72
5.6.80.0090.01615.70
5.6.70.0070.00814.44
5.6.60.0060.00614.36
5.6.50.0100.00414.40
5.6.40.0020.01114.50
5.6.30.0060.00914.34
5.6.20.0080.00614.48
5.6.10.0060.00714.42
5.6.00.0060.00714.40
5.5.380.0050.00714.48
5.5.370.0060.00714.39
5.5.360.0060.00914.38
5.5.350.0090.02115.53
5.5.340.0070.02115.10
5.5.330.0080.02315.67
5.5.320.0070.01515.56
5.5.310.0110.01215.60
5.5.300.0070.02015.13
5.5.290.0070.02215.15
5.5.280.0040.02415.72
5.5.270.0030.01515.72
5.5.260.0060.01915.74
5.5.250.0050.01415.59
5.5.240.0050.02415.39
5.5.230.0040.00814.37
5.5.220.0040.00914.30
5.5.210.0070.00514.37
5.5.200.0040.00714.35
5.5.190.0050.00914.43
5.5.180.0040.00714.35
5.5.170.0060.00514.23
5.5.160.0060.00614.46
5.5.150.0030.01014.29
5.5.140.0080.00414.36
5.5.130.0040.00914.34
5.5.120.0040.00814.40
5.5.110.0020.01014.27
5.5.100.0040.00814.38
5.5.90.0060.00714.37
5.5.80.0090.00214.45
5.5.70.0050.00714.17
5.5.60.0070.00714.33
5.5.50.0070.00514.41
5.5.40.0060.00714.25
5.5.30.0030.01114.32
5.5.20.0050.00914.30
5.5.10.0020.01014.26
5.5.00.0040.00714.34

preferences:
61.85 ms | 400 KiB | 5 Q