3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_disable(); class x { public $value; public $y; public function __construct($value) { $this->value = $value; $this->y = new y(); } } class y { } $array = array(); for($i = 0; $i < 50000; $i++) { $array[] = new x(md5('Hallo')); } var_dump(number_format(memory_get_usage(), 0, ',', '.')) . "\n"; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n"; unset($array); sleep(1); var_dump(gc_collect_cycles()) . "\n"; var_dump(number_format(memory_get_usage(), 0, ',', '.')) . "\n"; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n";

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.4.10.0070.05327.82
7.4.00.0060.05427.55
7.3.130.0170.03027.53
7.3.120.0190.03927.46
7.3.110.0100.03127.38
7.3.100.0070.04727.46
7.3.90.0160.03427.66
7.3.80.0100.03327.73
7.3.70.0190.02827.56
7.3.60.0130.03027.69
7.3.50.0200.02327.65
7.3.40.0130.03027.51
7.3.30.0130.03327.64
7.3.20.0070.03330.30
7.3.10.0100.03830.32
7.3.00.0070.04030.44
7.2.260.0190.03227.75
7.2.250.0130.03727.70
7.2.240.0100.03528.05
7.2.230.0160.02927.82
7.2.220.0160.03227.81
7.2.210.0130.04127.65
7.2.200.0070.03727.89
7.2.190.0230.02327.80
7.2.180.0100.04027.68
7.2.170.0130.03627.84
7.2.160.0170.02727.83
7.2.150.0160.03530.52
7.2.140.0130.02630.61
7.2.130.0200.02730.60
7.2.120.0100.03230.54
7.2.110.0070.03630.45
7.2.100.0130.03430.59
7.2.90.0060.03730.63
7.2.80.0130.03330.62
7.2.70.0200.02430.58
7.2.60.0100.02930.28
7.2.50.0070.03630.55
7.2.40.0100.04030.58
7.2.30.0160.03230.61
7.2.20.0130.03730.34
7.2.10.0260.02630.56
7.2.00.0110.03230.84
7.1.330.0160.04229.33
7.1.320.0100.04029.58
7.1.310.0070.05529.35
7.1.300.0100.04429.50
7.1.290.0130.03929.53
7.1.280.0200.03629.49
7.1.270.0130.04329.36
7.1.260.0100.04229.48
7.1.250.0070.05129.65
7.1.240.0100.04129.48
7.1.230.0070.04329.37
7.1.220.0200.03729.45
7.1.210.0130.03929.29
7.1.200.0030.04629.28
7.1.190.0070.04729.48
7.1.180.0070.04829.52
7.1.170.0100.05529.31
7.1.160.0200.04129.65
7.1.150.0070.04629.38
7.1.140.0230.04329.36
7.1.130.0130.04929.27
7.1.120.0250.03429.34
7.1.110.0190.04929.32
7.1.100.0250.04629.45
7.1.90.0230.04429.56
7.1.80.0190.04829.55
7.1.70.0110.05129.42
7.1.60.0090.04029.55
7.1.50.0140.05029.47
7.1.40.0280.03729.57
7.1.30.0180.04229.60
7.1.20.0160.04829.41
7.1.10.0260.03929.53
7.1.00.0090.07831.92
7.0.330.0130.04429.34
7.0.320.0140.04129.12
7.0.310.0030.05229.04
7.0.300.0100.04029.18
7.0.290.0000.05729.14
7.0.280.0130.03829.22
7.0.270.0160.03629.17
7.0.260.0140.04629.04
7.0.250.0160.05129.27
7.0.240.0190.04829.16
7.0.230.0110.04729.22
7.0.220.0240.04429.14
7.0.210.0070.05829.17
7.0.200.0130.03429.13
7.0.190.0200.04329.07
7.0.180.0170.04529.20
7.0.170.0210.04829.22
7.0.160.0150.05829.40
7.0.150.0180.04029.18
7.0.140.0160.07231.70
7.0.130.0160.04629.17
7.0.120.0200.04329.30
7.0.110.0130.05229.20
7.0.100.0070.05929.21
7.0.90.0100.06828.95
7.0.80.0130.05129.20
7.0.70.0200.04129.29
7.0.60.0150.07630.27
7.0.50.0210.07429.19
7.0.40.0100.08619.36
7.0.30.0370.07019.47
7.0.20.0190.05819.37
7.0.10.0140.08219.43
7.0.00.0160.06919.47
5.6.400.0160.08243.21
5.6.390.0070.09143.02
5.6.380.0190.07443.14
5.6.370.0200.07442.77
5.6.360.0270.07743.29
5.6.350.0340.06243.32
5.6.340.0390.06842.84
5.6.330.0260.07942.95
5.6.320.0230.08642.77
5.6.310.0110.10243.02
5.6.300.0260.09043.05
5.6.290.0240.09042.85
5.6.280.0230.10746.15
5.6.270.0200.08343.12
5.6.260.0190.09043.28
5.6.250.0200.09042.92
5.6.240.0210.08143.11
5.6.230.0350.07343.15
5.6.220.0260.09842.98
5.6.210.0140.08445.30
5.6.200.0140.08544.23
5.6.190.0230.08445.32
5.6.180.0380.10745.26
5.6.170.0270.08845.25
5.6.160.0250.10745.23
5.6.150.0250.09444.04
5.6.140.0200.10944.19
5.6.130.0250.07844.10
5.6.120.0180.09745.69
5.6.110.0240.11745.49
5.6.100.0220.11545.57
5.6.90.0210.10745.43
5.6.80.0310.10945.21
5.6.70.0230.08543.23
5.6.60.0260.07942.86
5.6.50.0320.07843.13
5.6.40.0270.09942.84
5.6.30.0320.07742.86
5.6.20.0260.07743.33
5.6.10.0230.08843.00
5.6.00.0280.08343.19
5.5.380.0260.07343.30
5.5.370.0270.07142.96
5.5.360.0160.09542.96
5.5.350.0350.09845.27
5.5.340.0230.11044.00
5.5.330.0170.11045.16
5.5.320.0350.10645.07
5.5.310.0240.10945.03
5.5.300.0150.08144.08
5.5.290.0100.09244.14
5.5.280.0150.10745.49
5.5.270.0150.07945.42
5.5.260.0270.10245.37
5.5.250.0210.10945.32
5.5.240.0200.10345.78
5.5.230.0200.07842.99
5.5.220.0230.07342.99
5.5.210.0370.07142.93
5.5.200.0170.07943.03
5.5.190.0100.08842.81
5.5.180.0200.08643.01
5.5.170.0200.07943.08
5.5.160.0230.07442.91
5.5.150.0200.08543.08
5.5.140.0230.06942.84
5.5.130.0230.07742.86
5.5.120.0270.07643.01
5.5.110.0060.08842.96
5.5.100.0270.06542.90
5.5.90.0360.06342.90
5.5.80.0260.08442.97
5.5.70.0270.07142.95
5.5.60.0100.08742.92
5.5.50.0210.08142.75
5.5.40.0140.09942.89
5.5.30.0430.05642.99
5.5.20.0160.08242.96
5.5.10.0100.08042.93
5.5.00.0290.07542.85
5.4.450.0620.10843.07
5.4.440.0810.09943.01
5.4.430.0800.11142.99
5.4.420.0880.10443.01
5.4.410.0420.11942.84
5.4.400.0430.10542.98
5.4.390.0730.10242.72
5.4.380.0630.10642.86
5.4.370.0800.10142.89
5.4.360.0750.11442.88
5.4.350.0250.09842.95
5.4.340.0240.08139.33
5.4.330.0070.09139.61
5.4.320.0200.08239.65
5.4.310.0170.08339.63
5.4.300.0180.08539.68
5.4.290.0150.08539.62
5.4.280.0160.08539.54
5.4.270.0200.08439.57
5.4.260.0170.08339.56
5.4.250.0160.08939.47
5.4.240.0170.08339.58
5.4.230.0200.08039.46
5.4.220.0180.07839.54
5.4.210.0170.08039.50
5.4.200.0240.07739.56
5.4.190.0220.08939.59
5.4.180.0220.08139.67
5.4.170.0160.09239.49
5.4.160.0260.08239.47
5.4.150.0190.08439.60
5.4.140.0230.08239.47
5.4.130.0160.08739.40
5.4.120.0170.08339.37
5.4.110.0220.07939.32
5.4.100.0280.10439.35
5.4.90.0080.08639.35
5.4.80.0180.07939.36
5.4.70.0150.08839.41
5.4.60.0120.08739.32
5.4.50.0190.07939.30
5.4.40.0160.08339.33
5.4.30.0130.09439.40
5.4.20.0150.08239.35
5.4.10.0200.08039.39
5.4.00.0230.08839.02
5.3.290.0230.13662.30
5.3.280.0330.12662.23
5.3.270.0220.13362.24
5.3.260.0190.13262.24
5.3.250.0200.13062.24
5.3.240.0250.13062.24
5.3.230.0250.13562.23
5.3.220.0180.13062.20
5.3.210.0290.12962.21
5.3.200.0220.12462.20
5.3.190.0240.12462.20
5.3.180.0230.12262.20
5.3.170.0260.12462.20
5.3.160.0270.11862.20
5.3.150.0200.12862.20
5.3.140.0240.12162.19
5.3.130.0220.12062.18
5.3.120.0280.11762.18
5.3.110.0230.12362.18
5.3.100.0240.12361.67
5.3.90.0300.12361.65
5.3.80.0210.12761.64
5.3.70.0170.12361.64
5.3.60.0190.12261.63
5.3.50.0220.12661.57
5.3.40.0310.13461.57
5.3.30.0240.11661.54
5.3.20.0240.11861.32
5.3.10.0170.12961.28
5.3.00.0160.12561.27
5.2.170.0070.0289.23
5.2.160.0040.0299.23
5.2.150.0070.0289.24
5.2.140.0050.0299.23
5.2.130.0020.0319.19
5.2.120.0030.0309.20
5.2.110.0030.0319.20
5.2.100.0060.0289.20
5.2.90.0060.0279.20
5.2.80.0040.0399.20
5.2.70.0060.0289.20
5.2.60.0050.0309.14
5.2.50.0050.0309.11
5.2.40.0040.0299.09
5.2.30.0080.0279.07
5.2.20.0020.0349.05
5.2.10.0030.0288.96
5.2.00.0070.0268.82
5.1.60.0070.0218.10
5.1.50.0060.0228.10
5.1.40.0020.0268.09
5.1.30.0050.0258.43
5.1.20.0050.0258.46
5.1.10.0050.0248.18
5.1.00.0040.0258.18
5.0.50.0040.0206.66
5.0.40.0040.0186.52
5.0.30.0040.0326.33
5.0.20.0040.0186.30
5.0.10.0060.0196.28
5.0.00.0020.0336.27
4.4.90.0040.0164.78
4.4.80.0020.0164.76
4.4.70.0030.0154.75
4.4.60.0030.0154.76
4.4.50.0030.0154.77
4.4.40.0020.0254.71
4.4.30.0030.0154.76
4.4.20.0060.0124.84
4.4.10.0040.0144.84
4.4.00.0030.0254.75
4.3.110.0060.0124.67
4.3.100.0020.0154.67
4.3.90.0030.0144.63
4.3.80.0010.0254.59
4.3.70.0010.0164.63
4.3.60.0070.0154.63
4.3.50.0050.0184.63
4.3.40.0030.0274.54
4.3.30.0030.0153.30
4.3.20.0010.0193.28
4.3.10.0020.0173.24
4.3.00.0170.0207.48

preferences:
33.9 ms | 401 KiB | 5 Q