3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NonLeakingClass { protected $x=[1,2,3,4,5,6,7,8,9,10]; public function __counstruct(){ } } class NonLeakingClass2 { protected $x=[1,2,3,4,5,6,7,8,9,10]; public function __counstruct(){ } } function test($x){ $ret = []; for($i=0;$i<(1022/2)*$x;$i++){ $ret[] = new NonLeakingClass(); $ret[] = new NonLeakingClass2(); } return $ret; } for ($h = 1; $h < 5; $h++) { echo "test $h \n\n"; var_dump(memory_get_usage(false)); $a = test($h); unset($a); gc_collect_cycles(); var_dump(memory_get_usage(false)); } exit;

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)
7.3.120.0080.00915.29
7.3.110.0040.01115.28
7.3.100.0020.01515.12
7.3.90.0030.01415.26
7.3.80.0020.01215.22
7.3.70.0060.00915.14
7.3.60.0040.01115.12
7.3.50.0050.01015.18
7.3.40.0020.01315.33
7.3.30.0020.01315.07
7.3.20.0070.00616.55
7.3.10.0090.00716.56
7.3.00.0050.01016.57
7.2.240.0060.00915.13
7.2.230.0060.01015.55
7.2.220.0100.00615.32
7.2.210.0070.00915.48
7.2.200.0090.00715.42
7.2.190.0080.01015.44
7.2.180.0060.00815.27
7.2.170.0090.00615.52
7.2.160.0040.01315.41
7.2.150.0050.01016.78
7.2.140.0020.01116.99
7.2.130.0050.01016.85
7.2.120.0080.01016.91
7.2.110.0290.01116.36
7.2.100.0290.01015.94
7.2.90.0350.01016.04
7.2.80.0460.00716.01
7.2.70.0340.00816.21
7.2.60.0420.00816.20
7.2.50.0420.00816.19
7.2.40.0400.00616.10
7.2.30.0360.01016.16
7.2.20.0380.01016.02
7.2.10.0400.00716.17
7.2.00.0390.00816.06
7.1.330.0040.01115.83
7.1.320.0040.01315.72
7.1.310.0060.01015.61
7.1.300.0070.01015.82
7.1.290.0100.00515.83
7.1.280.0070.01115.85
7.1.270.0100.00515.57
7.1.260.0080.00815.68
7.1.250.0060.01015.80
7.1.230.0800.00314.47
7.1.220.0460.00914.28
7.1.210.0680.00614.20
7.1.200.0640.00514.21
7.1.190.0600.00814.01
7.1.180.0800.00914.29
7.1.170.0760.01214.43
7.1.160.1390.00714.15
7.1.150.0710.00714.03
7.1.140.0770.01114.18
7.1.130.0640.00514.13
7.1.120.0750.00514.08
7.1.110.0720.01014.18
7.1.100.0570.01114.32
7.1.90.0710.00814.06
7.1.80.0720.01013.90
7.1.70.0670.01114.23
7.1.60.0950.00732.09
7.1.50.0880.01332.09
7.1.40.0900.01032.10
7.1.30.1060.00832.23
7.1.20.0900.01632.43
7.1.10.0690.00514.02
7.1.00.0940.01114.22
7.0.310.0900.00713.92
7.0.300.1210.00713.83
7.0.290.0910.01313.65
7.0.280.0920.00313.94
7.0.270.0920.00613.76
7.0.260.1150.00613.70
7.0.250.1110.00013.99
7.0.240.0850.01314.03
7.0.230.1010.00914.00
7.0.220.0970.01714.12
7.0.210.0940.01014.04
7.0.200.0780.00713.73
7.0.190.0950.00413.93
7.0.180.1230.01013.93
7.0.170.1110.01314.01
7.0.160.1500.00714.00
7.0.150.0900.00913.69
7.0.140.0630.00313.86
7.0.130.1010.01014.09
7.0.120.0830.00313.87
7.0.110.0730.01214.03
7.0.100.1130.00913.89
7.0.90.0920.00314.02
7.0.80.0850.00014.00
7.0.70.0690.00914.10
7.0.60.0630.01514.06
7.0.50.1200.00014.08
7.0.40.1180.00314.03
7.0.30.1130.01013.82
7.0.20.0980.01613.81
7.0.10.0740.00613.92
7.0.00.0950.00613.98
5.6.380.0140.00015.01
5.6.370.0180.00915.73
5.6.360.0140.01515.23
5.6.350.0120.01215.59
5.6.340.0190.00515.79
5.6.330.0140.01315.51
5.6.320.0190.00415.30
5.6.310.0070.01815.54
5.6.300.0080.01915.39
5.6.290.0050.02215.37
5.6.280.0150.00915.64
5.6.270.0050.02115.61
5.6.260.0150.01115.58
5.6.250.0160.01215.29
5.6.240.0060.01815.57
5.6.230.0090.01815.18
5.6.220.0120.01215.41
5.6.210.0040.01915.23
5.6.200.0090.01315.36
5.6.190.0170.00715.27
5.6.180.0160.00715.39
5.6.170.0130.01615.52
5.6.160.0100.01715.41
5.6.150.0100.01315.25
5.6.140.0100.01315.34
5.6.130.0150.01215.36
5.6.120.0120.01215.58
5.6.110.0170.00415.23
5.6.100.0120.01515.25
5.6.90.0100.01015.61
5.6.80.0280.00015.50
5.6.70.0050.02315.24
5.6.60.0180.00915.48
5.6.50.0140.01415.15
5.6.40.0110.01115.29
5.6.30.0160.01215.44
5.6.20.0220.00715.30
5.6.10.0060.01715.64
5.6.00.0130.01115.41
5.5.380.0050.01412.41
5.5.370.0160.00312.42
5.5.360.0100.01312.36
5.5.350.0180.00412.49
5.5.340.0080.01212.42
5.5.330.0080.01512.32
5.5.320.0100.01312.51
5.5.310.0210.00012.28
5.5.300.0150.00812.09
5.5.290.0110.00612.55
5.5.280.0070.01012.68
5.5.270.0130.00312.52
5.5.260.0090.01112.58
5.5.250.0150.00412.45
5.5.240.0140.00712.47
5.5.230.0150.00612.32
5.5.220.0130.01012.40
5.5.210.0140.00912.11
5.5.200.0160.00812.25
5.5.190.0120.00911.96
5.5.180.0120.00612.32
5.5.170.0150.01215.35
5.5.160.0120.00812.50
5.5.150.0130.00412.15
5.5.140.0140.00412.43
5.5.130.0120.00612.56
5.5.120.0110.01112.46
5.5.110.0140.00612.02
5.5.100.0100.01012.41
5.5.90.0130.00712.45
5.5.80.0100.00712.50
5.5.70.0120.01212.31
5.5.60.0260.00412.25
5.5.50.0110.00912.35
5.5.40.0080.01512.16
5.5.30.0100.00612.51
5.5.20.0070.01412.40
5.5.10.0120.00912.40
5.5.00.0130.00512.43
5.4.450.0140.00312.02
5.4.440.0110.00512.43
5.4.430.0120.00612.35
5.4.420.0130.00812.35
5.4.410.0080.00812.56
5.4.400.0170.00612.26
5.4.390.0030.01612.46
5.4.380.0060.01312.22
5.4.370.0130.00712.24
5.4.360.0190.00312.44
5.4.350.0050.01412.25
5.4.340.0110.00712.38
5.4.330.0170.00712.38
5.4.320.0100.00812.29
5.4.310.0110.01112.24
5.4.300.0100.01012.57
5.4.290.0100.01311.88
5.4.280.0120.01212.41
5.4.270.0080.00812.64
5.4.260.0150.00712.39
5.4.250.0040.01712.34
5.4.240.0130.01012.25
5.4.230.0100.01012.16
5.4.220.0030.01712.30
5.4.210.0050.01512.05
5.4.200.0110.01211.97
5.4.190.0120.00612.53
5.4.180.0090.01312.43
5.4.170.0200.00312.49
5.4.160.0140.00312.27
5.4.150.0070.01112.41
5.4.140.0120.01212.39
5.4.130.0110.00812.25
5.4.120.0090.01312.03
5.4.110.0220.00012.10
5.4.100.0100.01412.05
5.4.90.0100.01012.39
5.4.80.0150.00512.38
5.4.70.0180.00312.29
5.4.60.0150.00812.15
5.4.50.0090.01212.35
5.4.40.0110.00512.29
5.4.30.0110.00812.32
5.4.20.0140.00712.13
5.4.10.0140.00312.18
5.4.00.0070.01412.53
5.3.290.0090.00610.39
5.3.280.0140.00010.19
5.3.270.0110.00210.35
5.3.260.0120.00310.13
5.3.250.0000.01510.28
5.3.240.0090.0059.96
5.3.230.0050.00510.22
5.3.220.0130.00010.27
5.3.210.0120.00510.28
5.3.200.0130.00310.11
5.3.190.0110.00010.18
5.3.180.0080.00610.25
5.3.170.0100.00510.46
5.3.160.0120.00310.19
5.3.150.0080.00410.41
5.3.140.0100.00010.13
5.3.130.0050.01110.33
5.3.120.0090.00910.18
5.3.110.0080.00510.13
5.3.100.0150.00010.30
5.3.90.0110.00310.45
5.3.80.0070.00710.27
5.3.70.0100.00010.32
5.3.60.0090.00610.33
5.3.50.0050.01110.04
5.3.40.0120.00610.15
5.3.30.0050.0089.97
5.3.20.0040.00810.24
5.3.10.0050.01010.05
5.3.00.0100.00310.05
5.2.170.0090.0009.43
5.2.160.0050.0059.07
5.2.150.0100.0009.35
5.2.140.0060.0049.29
5.2.130.0060.0069.29
5.2.120.0060.0069.01
5.2.110.0080.0049.29
5.2.100.0060.0069.26
5.2.90.0030.0099.37
5.2.80.0060.0069.27
5.2.70.0040.0089.25
5.2.60.0000.0129.01
5.2.50.0090.0029.23
5.2.40.0080.0029.03
5.2.30.0070.0078.93
5.2.20.0090.0038.92
5.2.10.0080.0049.00
5.2.00.0090.0008.94
5.1.60.0100.0008.59
5.1.50.0000.0088.59
5.1.40.0000.0088.59
5.1.30.0090.0038.59
5.1.20.0080.0008.59
5.1.10.0030.0068.59
5.1.00.0100.0008.59
5.0.50.0050.0028.59
5.0.40.0040.0048.59
5.0.30.0040.0048.59
5.0.20.0090.0008.59
5.0.10.0020.0058.59
5.0.00.0060.0038.59
4.4.90.0000.0088.59
4.4.80.0030.0048.59
4.4.70.0000.0078.59
4.4.60.0060.0008.59
4.4.50.0070.0008.59
4.4.40.0040.0048.59
4.4.30.0000.0068.59
4.4.20.0000.0058.59
4.4.10.0060.0008.59
4.4.00.0040.0048.59
4.3.110.0070.0008.59
4.3.100.0040.0048.59
4.3.90.0040.0038.59
4.3.80.0000.0088.59
4.3.70.0000.0068.59
4.3.60.0030.0038.59
4.3.50.0060.0008.59
4.3.40.0070.0008.59
4.3.30.0000.0078.59
4.3.20.0060.0008.59
4.3.10.0000.0048.59
4.3.00.0030.0038.59

preferences:
44.37 ms | 400 KiB | 5 Q