3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classNames = array( "Foo", // userland class "StdClass", // class defined by php-src, but still not considered as internal "ReflectionClass", // internal class "ArrayObject", // internal class implementing Serializable ); foreach($classNames as $className) { var_dump(instanitateWithoutConstructorThroughUnserialize($className)); if (version_compare(PHP_VERSION, '5.4.0') >= 0) { var_dump(instanitateWithoutConstructorThroughReflection($className)); } } function instanitateWithoutConstructorThroughUnserialize($className) { return unserialize(sprintf('O:%d:"%s":0:{}', strlen($className), $className)); } function instanitateWithoutConstructorThroughReflection($className) { try { $ref = new ReflectionClass($className); return $ref->newInstanceWithoutConstructor(); } catch (ReflectionException $e) { return $e; } } class Foo {}

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.0090.01218.28
8.3.50.0050.01121.95
8.3.40.0150.00018.80
8.3.30.0030.01019.27
8.3.20.0040.00420.20
8.3.10.0090.00023.52
8.3.00.0080.00019.50
8.2.180.0090.00618.18
8.2.170.0100.00722.96
8.2.160.0100.00320.47
8.2.150.0040.00424.18
8.2.140.0110.00724.66
8.2.130.0040.00426.16
8.2.120.0060.00922.00
8.2.110.0070.01022.18
8.2.100.0090.00319.64
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0040.00718.03
8.2.50.0000.00818.07
8.2.40.0000.00820.00
8.2.30.0040.00418.30
8.2.20.0040.00417.81
8.2.10.0070.00018.10
8.2.00.0090.00017.71
8.1.280.0140.00725.92
8.1.270.0060.00323.88
8.1.260.0040.00426.35
8.1.250.0100.00028.09
8.1.240.0060.00323.84
8.1.230.0040.00719.08
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0100.00017.47
8.1.190.0050.00317.36
8.1.180.0030.00518.10
8.1.170.0000.01018.45
8.1.160.0040.00422.04
8.1.150.0000.00718.68
8.1.140.0040.00417.38
8.1.130.0000.00817.89
8.1.120.0000.00717.50
8.1.110.0080.00017.37
8.1.100.0070.00017.40
8.1.90.0030.00617.51
8.1.80.0000.00717.39
8.1.70.0000.00717.33
8.1.60.0080.00417.52
8.1.50.0000.00817.45
8.1.40.0100.00017.44
8.1.30.0040.00417.70
8.1.20.0040.00417.64
8.1.10.0050.00317.55
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0040.00416.91
8.0.280.0030.00318.47
8.0.270.0070.00017.17
8.0.260.0000.00617.32
8.0.250.0070.00017.06
8.0.240.0070.00016.95
8.0.230.0050.00217.09
8.0.220.0000.00716.98
8.0.210.0050.00316.87
8.0.200.0040.00416.87
8.0.190.0070.00016.91
8.0.180.0040.00416.96
8.0.170.0000.00816.98
8.0.160.0000.00717.05
8.0.150.0030.00416.93
8.0.140.0050.00316.97
8.0.130.0060.00013.40
8.0.120.0040.00416.85
8.0.110.0050.00316.99
8.0.100.0000.00816.87
8.0.90.0000.00817.03
8.0.80.0170.00716.94
8.0.70.0040.00416.87
8.0.60.0040.00416.78
8.0.50.0000.00716.77
8.0.30.0090.01017.28
8.0.20.0120.00917.40
8.0.10.0040.00416.87
8.0.00.0100.01016.91
7.4.330.0000.00515.00
7.4.320.0060.00316.48
7.4.300.0060.00016.64
7.4.290.0030.00616.62
7.4.280.0040.00416.39
7.4.270.0030.00316.45
7.4.260.0040.00416.43
7.4.250.0040.00416.63
7.4.240.0030.00416.61
7.4.230.0000.00716.65
7.4.220.0150.01516.57
7.4.210.0110.00516.70
7.4.200.0070.00016.43
7.4.190.0040.00416.52
7.4.160.0080.00816.55
7.4.150.0200.00717.40
7.4.140.0100.01217.86
7.4.130.0060.01116.58
7.4.120.0090.00816.62
7.4.110.0070.01016.46
7.4.100.0060.01316.80
7.4.90.0040.01416.75
7.4.80.0160.00819.39
7.4.70.0080.01516.56
7.4.60.0100.01016.56
7.4.50.0080.00016.37
7.4.40.0150.00616.58
7.4.30.0040.01916.64
7.4.00.0100.00714.83
7.3.330.0000.00513.38
7.3.320.0060.00013.48
7.3.310.0070.00016.31
7.3.300.0030.00316.31
7.3.290.0040.01116.51
7.3.280.0110.00716.43
7.3.270.0130.00417.40
7.3.260.0100.00716.65
7.3.250.0110.00616.56
7.3.240.0180.00616.43
7.3.230.0000.01516.40
7.3.210.0130.00316.55
7.3.200.0090.01219.39
7.3.190.0080.01216.54
7.3.180.0110.00716.69
7.3.170.0110.00416.48
7.3.160.0080.01416.54
7.3.120.0030.00914.72
7.3.10.0050.01416.57
7.3.00.0080.00816.75
7.2.330.0100.00716.52
7.2.320.0140.00916.73
7.2.310.0130.01016.49
7.2.300.0140.00316.84
7.2.290.0090.01016.68
7.2.130.0090.00616.92
7.2.120.0090.00316.94
7.2.110.0080.00416.96
7.2.100.0050.01016.71
7.2.90.0090.00617.01
7.2.80.0100.00516.85
7.2.70.0060.00916.98
7.2.60.0050.00716.79
7.2.50.0100.00516.98
7.2.40.0130.00216.88
7.2.30.0070.00716.76
7.2.20.0060.01216.81
7.2.10.0030.01017.00
7.2.00.0050.00916.91
7.1.250.0060.00915.68
7.1.240.0100.01015.57
7.1.230.0150.00415.48
7.1.220.0080.00415.60
7.1.210.0130.00715.70
7.1.200.0130.00615.76
7.1.190.0200.00715.64
7.1.180.0100.00715.60
7.1.170.0150.00315.40
7.1.160.0060.00915.87
7.1.150.0070.01015.93
7.1.140.0060.00615.67
7.1.130.0110.00415.56
7.1.120.0120.00015.78
7.1.110.0110.00315.50
7.1.100.0000.00915.53
7.1.90.0070.00715.84
7.1.80.0060.00615.63
7.1.70.0080.00216.35
7.1.60.0040.01117.73
7.1.50.0010.01216.43
7.1.40.0070.00715.70
7.1.30.0100.00715.71
7.1.20.0060.00615.66
7.1.10.0100.00315.53
7.1.00.0070.04018.97
7.0.330.0150.00315.39
7.0.320.0130.00715.52
7.0.310.0070.01015.49
7.0.300.0070.00715.41
7.0.290.0040.00715.41
7.0.280.0080.00815.27
7.0.270.0000.01115.44
7.0.260.0030.00915.05
7.0.250.0040.01115.29
7.0.240.0030.00615.30
7.0.230.0030.01315.37
7.0.220.0000.00715.39
7.0.210.0060.00615.35
7.0.200.0050.00515.81
7.0.190.0030.01214.98
7.0.180.0080.00315.31
7.0.170.0050.01015.37
7.0.160.0090.00615.20
7.0.150.0000.01015.46
7.0.140.0030.03818.68
7.0.130.0100.00015.56
7.0.120.0050.00915.41
7.0.110.0030.01015.38
7.0.100.0060.00315.55
7.0.90.0000.01015.49
7.0.80.0000.01415.16
7.0.70.0050.00315.34
7.0.60.0050.04617.84
7.0.50.0040.04616.55
7.0.40.0080.03916.81
7.0.30.0170.04216.82
7.0.20.0170.04216.94
7.0.10.0070.02216.78
7.0.00.0050.03316.68
5.6.380.0100.00014.24
5.6.370.0060.01014.25
5.6.360.0040.01114.38
5.6.350.0040.01414.51
5.6.340.0070.00314.34
5.6.330.0060.00814.26
5.6.320.0030.01214.48
5.6.310.0070.00714.49
5.6.300.0000.00714.01
5.6.290.0070.00714.33
5.6.280.0080.03817.76
5.6.270.0030.01014.69
5.6.260.0060.00614.35
5.6.250.0060.00614.36
5.6.240.0070.00314.44
5.6.230.0030.01014.46
5.6.220.0040.01114.46
5.6.210.0080.03817.53
5.6.200.0060.04116.23
5.6.190.0050.04417.36
5.6.180.0100.04417.40
5.6.170.0170.02717.33
5.6.160.0080.03517.46
5.6.150.0060.03316.25
5.6.140.0060.03916.27
5.6.130.0090.04016.29
5.6.120.0070.04217.68
5.6.110.0080.04517.70
5.6.100.0020.02417.70
5.6.90.0120.03617.63
5.6.80.0050.02417.30
5.6.70.0040.00714.34
5.6.60.0000.01114.27
5.6.50.0090.00314.21
5.6.40.0030.00814.16
5.6.30.0060.00314.46
5.6.20.0040.00814.42
5.6.10.0070.00414.44
5.6.00.0130.00014.26
5.5.380.0000.01410.88
5.5.370.0030.00311.07
5.5.360.0030.00911.34
5.5.350.2180.01915.82
5.5.340.0080.03614.56
5.5.330.0070.02315.48
5.5.320.0180.04115.77
5.5.310.0210.03715.82
5.5.300.0060.04214.66
5.5.290.0030.04714.47
5.5.280.0050.04515.96
5.5.270.0100.04216.13
5.5.260.0090.02216.09
5.5.250.0030.03515.87
5.5.240.0030.02615.83
5.5.230.0030.00710.98
5.5.220.0000.00811.28
5.5.210.0000.00811.24
5.5.200.0000.00911.12
5.5.190.0040.00811.34
5.5.180.0100.00311.33
5.5.170.0080.00410.98
5.5.160.0030.00311.13
5.5.150.0040.00411.20
5.5.140.0030.00610.96
5.5.130.0030.00311.10
5.5.120.0000.00911.30
5.5.110.0060.00010.75
5.5.100.0000.00911.30
5.5.90.0000.00711.20
5.5.80.0070.00411.30
5.5.70.0040.00410.96
5.5.60.0000.00811.10
5.5.50.0000.01411.21
5.5.40.0030.00611.01
5.5.30.0030.00711.22
5.5.20.0040.00411.19
5.5.10.0090.00311.32
5.5.00.0030.00610.85
5.4.450.0500.04515.32
5.4.440.0450.04015.34
5.4.430.0400.03815.21
5.4.420.0430.03015.16
5.4.410.0080.03015.24
5.4.400.0080.03415.06
5.4.390.0430.02915.22
5.4.380.0230.02814.90
5.4.370.0150.03114.77
5.4.360.0150.03014.89
5.4.350.0170.03314.88
5.4.340.0260.02314.91
5.4.330.0060.00310.88
5.4.320.0040.01911.63
5.4.310.0060.02411.58
5.4.300.0040.02311.62
5.4.290.0080.02111.74
5.4.280.0070.02211.64
5.4.270.0080.02411.81
5.4.260.0070.02111.88
5.4.250.0070.02411.78
5.4.240.0060.02311.73
5.4.230.0040.02611.62
5.4.220.0100.02911.65
5.4.210.0060.03011.52
5.4.200.0040.02811.54
5.4.190.0060.03511.71
5.4.180.0090.02911.64
5.4.170.0050.02811.73
5.4.160.0060.02511.66
5.4.150.0080.02011.71
5.4.140.0040.02411.60
5.4.130.0090.01911.54
5.4.120.0070.02111.60
5.4.110.0070.02311.52
5.4.100.0070.02211.58
5.4.90.0070.02611.38
5.4.80.0040.02411.52
5.4.70.0080.02711.39
5.4.60.0070.02511.53
5.4.50.0040.02511.56
5.4.40.0080.03011.60
5.4.30.0110.03011.41
5.4.20.0090.03011.43
5.4.10.0130.02711.50
5.4.00.0070.03011.15
5.3.290.0060.02111.77
5.3.280.0070.02311.66
5.3.270.0040.03011.65
5.3.260.0060.02711.58
5.3.250.0100.02711.52
5.3.240.0080.02611.62
5.3.230.0050.03211.54
5.3.220.0060.03411.41
5.3.210.0070.02611.50
5.3.200.0060.03011.61
5.3.190.0070.02511.59
5.3.180.0070.02811.65
5.3.170.0080.02711.59
5.3.160.0040.02411.64
5.3.150.0070.02411.64
5.3.140.0040.02311.59
5.3.130.0060.02111.50
5.3.120.0070.02011.63
5.3.110.0030.02711.58
5.3.100.0050.02511.33
5.3.90.0060.04011.38
5.3.80.0070.03011.27
5.3.70.0030.03011.32
5.3.60.0080.01911.25
5.3.50.0060.02311.17
5.3.40.0050.03011.28
5.3.30.0100.02511.27
5.3.20.0080.02711.09
5.3.10.0020.03011.03
5.3.00.0060.02610.94
5.2.170.0050.0169.59
5.2.160.0040.0209.59
5.2.150.0020.0199.59
5.2.140.0020.0209.59
5.2.130.0030.0189.57
5.2.120.0030.0169.57
5.2.110.0040.0189.57
5.2.100.0010.0239.57
5.2.90.0060.0169.57
5.2.80.0070.0179.57
5.2.70.0030.0249.57
5.2.60.0060.0149.55
5.2.50.0060.0159.53
5.2.40.0030.0189.52
5.2.30.0040.0159.51
5.2.20.0040.0179.50
5.2.10.0080.0149.45
5.2.00.0030.0189.39
5.1.60.0040.0169.03
5.1.50.0050.0159.03
5.1.40.0040.0159.02
5.1.30.0050.0159.19
5.1.20.0060.0199.20
5.1.10.0040.0209.06
5.1.00.0070.0189.06
5.0.50.0020.0148.30
5.0.40.0030.0128.23
5.0.30.0050.0178.14
5.0.20.0020.0148.13
5.0.10.0030.0128.11
5.0.00.0060.0228.11
4.4.90.0030.0207.37
4.4.80.0040.0137.36
4.4.70.0040.0227.36
4.4.60.0040.0247.36
4.4.50.0040.0157.36
4.4.40.0060.0237.33
4.4.30.0020.0177.36
4.4.20.0010.0177.40
4.4.10.0020.0157.40
4.4.00.0020.0247.36
4.3.110.0070.0127.31
4.3.100.0050.0147.31
4.3.90.0030.0157.30
4.3.80.0040.0197.27
4.3.70.0060.0137.29
4.3.60.0020.0167.29
4.3.50.0040.0137.29
4.3.40.0020.0197.25
4.3.30.0010.0146.63
4.3.20.0030.0126.62
4.3.10.0040.0136.60
4.3.00.0030.0139.48

preferences:
50.32 ms | 401 KiB | 5 Q