3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $a = array(); function getA() { return $this->a; } } $byReflection = (new ReflectionClass('Test'))->newInstanceWithoutConstructor(); $bySerialization = unserialize('O:4:"Test":0:{}'); $bySerializationWithProperty = unserialize(sprintf('O:4:"Test":1:{%s%s', serialize("\0*\0a"), serialize(array()))); var_dump($byReflection); var_dump($bySerialization); var_dump($bySerializationWithProperty);

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.0150.00016.63
8.3.50.0080.00921.88
8.3.40.0110.00418.75
8.3.30.0090.00919.05
8.3.20.0040.00420.21
8.3.10.0000.00823.62
8.3.00.0000.00819.06
8.2.180.0080.00818.66
8.2.170.0070.00722.96
8.2.160.0090.00620.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.91
8.2.110.0030.00622.16
8.2.100.0130.00017.91
8.2.90.0040.00419.27
8.2.80.0040.00417.97
8.2.70.0060.00317.61
8.2.60.0060.00317.93
8.2.50.0060.00318.07
8.2.40.0000.00819.88
8.2.30.0040.00418.19
8.2.20.0040.00417.45
8.2.10.0050.00218.07
8.2.00.0040.00417.57
8.1.280.0090.01225.92
8.1.270.0050.00323.79
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0080.00323.92
8.1.230.0000.01119.15
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0000.00817.35
8.1.190.0040.00417.10
8.1.180.0060.00318.10
8.1.170.0000.00818.45
8.1.160.0070.00022.00
8.1.150.0000.00718.48
8.1.140.0070.00017.34
8.1.130.0000.00817.79
8.1.120.0070.00017.30
8.1.110.0000.00717.44
8.1.100.0040.00317.30
8.1.90.0000.00817.29
8.1.80.0000.00717.29
8.1.70.0000.00717.40
8.1.60.0040.00417.48
8.1.50.0050.00317.41
8.1.40.0060.00317.38
8.1.30.0030.00517.57
8.1.20.0070.00017.58
8.1.10.0040.00417.49
8.1.00.0040.00417.34
8.0.300.0000.00718.77
8.0.290.0080.00017.03
8.0.280.0000.00718.38
8.0.270.0030.00317.11
8.0.260.0000.00717.27
8.0.250.0000.00716.87
8.0.240.0000.00716.97
8.0.230.0060.00316.95
8.0.220.0000.00816.83
8.0.210.0000.00716.84
8.0.200.0060.00017.02
8.0.190.0000.00716.96
8.0.180.0040.00416.93
8.0.170.0040.00416.81
8.0.160.0040.00416.79
8.0.150.0000.00716.88
8.0.140.0000.00716.76
8.0.130.0060.00013.27
8.0.120.0000.00816.88
8.0.110.0000.00816.91
8.0.100.0040.00416.92
8.0.90.0070.00016.78
8.0.80.0120.00316.96
8.0.70.0080.00016.87
8.0.60.0030.00616.93
8.0.50.0050.00216.92
8.0.30.0100.01017.26
8.0.20.0040.01417.40
8.0.10.0000.00716.90
8.0.00.0060.01216.68
7.4.330.0000.00515.09
7.4.320.0000.00616.50
7.4.300.0030.00516.41
7.4.290.0020.00516.53
7.4.280.0070.00016.53
7.4.270.0000.00716.47
7.4.260.0000.00716.45
7.4.250.0040.00416.41
7.4.240.0050.00216.48
7.4.230.0000.00716.52
7.4.220.0110.01116.61
7.4.210.0060.00816.49
7.4.200.0070.00016.50
7.4.190.0030.00316.61
7.4.160.0060.00916.37
7.4.150.0100.00717.40
7.4.140.0110.00717.86
7.4.130.0110.00516.48
7.4.120.0060.01116.36
7.4.110.0100.00716.58
7.4.100.0120.00616.52
7.4.90.0070.01016.48
7.4.80.0060.01219.39
7.4.70.0100.01316.27
7.4.60.0060.01116.41
7.4.50.0030.00616.43
7.4.40.0070.01116.29
7.4.30.0130.00316.48
7.4.00.0100.00615.17
7.3.330.0070.00013.13
7.3.320.0000.00613.22
7.3.310.0000.00716.14
7.3.300.0040.00416.27
7.3.290.0060.01516.27
7.3.280.0060.01116.23
7.3.270.0140.00317.40
7.3.260.0080.00816.24
7.3.250.0080.00816.46
7.3.240.0100.00716.19
7.3.230.0100.01016.39
7.3.210.0110.00616.42
7.3.200.0120.00919.39
7.3.190.0180.00616.46
7.3.180.0060.00916.24
7.3.170.0030.01316.34
7.3.160.0060.01316.56
7.3.120.0070.01014.86
7.2.330.0070.01016.66
7.2.320.0030.02016.41
7.2.310.0110.01116.39
7.2.300.0030.01516.31
7.2.290.0100.01316.55
7.2.00.0030.01019.19
7.1.100.0070.00717.82
7.1.70.0050.00216.89
7.1.60.0040.00719.46
7.1.50.0270.01034.71
7.1.00.0100.07022.34
7.0.200.0030.00616.70
7.0.140.0070.06722.00
7.0.60.0200.04720.02
7.0.50.0070.03717.97
7.0.40.0030.08720.21
7.0.30.0230.04020.09
7.0.20.0230.04720.24
7.0.10.0030.08020.12
7.0.00.0030.08020.07
5.6.280.0130.06321.13
5.6.210.0130.07020.69
5.6.200.0000.06718.27
5.6.190.0070.08320.50
5.6.180.0000.09020.49
5.6.170.0230.04020.47
5.6.160.0030.04320.48
5.6.150.0030.08018.18
5.6.140.0170.07018.11
5.6.130.0100.05718.23
5.6.120.0030.04321.00
5.6.110.0130.07320.97
5.6.100.0030.08721.02
5.6.90.0170.07020.97
5.6.80.0070.03720.50
5.5.350.0030.08020.30
5.5.340.0170.06717.95
5.5.330.0000.05020.43
5.5.320.0230.04320.42
5.5.310.0300.03720.32
5.5.300.0030.04017.95
5.5.290.0030.04017.95
5.5.280.0130.07020.87
5.5.270.0070.04320.88
5.5.260.0170.07020.88
5.5.250.0000.09020.49
5.5.240.0100.07320.16
5.4.450.0870.05319.45
5.4.440.0730.06019.63
5.4.430.1070.05019.20
5.4.420.0930.05019.31
5.4.410.0700.05719.16
5.4.400.1100.05018.91
5.4.390.1100.05019.05
5.4.380.0270.04018.80
5.4.370.0170.05318.77
5.4.360.0130.05018.61
5.4.350.0200.04718.58
5.4.340.0100.05318.63
5.4.320.0100.03112.50
5.4.310.0080.03812.49
5.4.300.0070.04212.50
5.4.290.0080.04212.50
5.4.280.0120.04112.39
5.4.270.0140.04712.40
5.4.260.0100.05012.39
5.4.250.0110.04912.39
5.4.240.0070.06312.39
5.4.230.0140.04612.39
5.4.220.0090.03912.39
5.4.210.0090.04712.38
5.4.200.0080.04112.39
5.4.190.0060.03812.39
5.4.180.0110.03912.38
5.4.170.0120.04712.39
5.4.160.0080.04712.39
5.4.150.0050.04112.38
5.4.140.0050.05212.07
5.4.130.0090.04912.05
5.4.120.0120.04912.02
5.4.110.0070.05412.01
5.4.100.0090.04612.02
5.4.90.0110.05012.02
5.4.80.0100.05312.02
5.4.70.0060.05512.01
5.4.60.0050.04812.01
5.4.50.0070.04212.01
5.4.40.0070.03412.00
5.4.30.0100.04511.99
5.4.20.0070.04312.00
5.4.10.0040.03812.00
5.4.00.0070.05111.49
5.3.290.0100.03912.80
5.3.280.0050.05512.71
5.3.270.0120.04512.72
5.3.260.0100.05112.72
5.3.250.0070.05712.72
5.3.240.0080.05412.72
5.3.230.0080.05212.71
5.3.220.0050.05712.68
5.3.210.0110.05012.68
5.3.200.0070.05212.68
5.3.190.0070.05212.68
5.3.180.0120.04812.67
5.3.170.0090.04912.67
5.3.160.0060.04412.68
5.3.150.0050.04712.68
5.3.140.0080.04312.66
5.3.130.0080.04012.66
5.3.120.0080.03912.66
5.3.110.0120.03912.66
5.3.100.0140.04512.12
5.3.90.0090.04012.10
5.3.80.0090.04012.09
5.3.70.0080.04612.10
5.3.60.0090.04712.08
5.3.50.0090.04412.03
5.3.40.0080.03612.02
5.3.30.0080.03511.98
5.3.20.0100.03711.77
5.3.10.0070.04111.73
5.3.00.0060.05011.72
5.2.170.0040.0399.22
5.2.160.0100.0389.22
5.2.150.0070.0399.22
5.2.140.0070.0349.21
5.2.130.0050.0319.18
5.2.120.0060.0309.18
5.2.110.0080.0389.19
5.2.100.0070.0399.18
5.2.90.0070.0309.18
5.2.80.0020.0389.17
5.2.70.0080.0379.18
5.2.60.0050.0369.13
5.2.50.0060.0309.10
5.2.40.0040.0359.07
5.2.30.0070.0409.05
5.2.20.0070.0379.04
5.2.10.0070.0348.95
5.2.00.0070.0308.81
5.1.60.0060.0238.09
5.1.50.0020.0288.09
5.1.40.0060.0348.06
5.1.30.0110.0318.41
5.1.20.0070.0358.44
5.1.10.0050.0268.16
5.1.00.0080.0298.17
5.0.50.0040.0286.64
5.0.40.0040.0276.51
5.0.30.0020.0346.31
5.0.20.0050.0226.28
5.0.10.0040.0236.26
5.0.00.0080.0266.25
4.4.90.0050.0144.78
4.4.80.0030.0154.75
4.4.70.0020.0174.76
4.4.60.0010.0184.75
4.4.50.0030.0164.77
4.4.40.0050.0254.71
4.4.30.0020.0184.76
4.4.20.0040.0154.84
4.4.10.0030.0234.84
4.4.00.0020.0324.76
4.3.110.0050.0214.67
4.3.100.0070.0184.67
4.3.90.0020.0224.64
4.3.80.0020.0264.59
4.3.70.0030.0164.63
4.3.60.0040.0144.63
4.3.50.0020.0174.63
4.3.40.0010.0264.54
4.3.30.0000.0183.30
4.3.20.0010.0183.28
4.3.10.0010.0183.24
4.3.00.0070.0177.28

preferences:
45.43 ms | 401 KiB | 5 Q