3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo extends ArrayObject { public $x; public function __construct($self) { $this->x = $self; } } Class Bar { static function create(){ $b = new Bar(); $b->f = new Foo($b->get()); } function get(){ $self = $this; return function() use ($self) {return $self;}; } } echo memory_get_usage(), "\n"; for ($i = 0; $i < 1000; ++$i) { Bar::create(); } echo gc_collect_cycles() . "\n"; echo memory_get_usage(), "\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.3.10.0320.00318.49
7.3.00.0170.00718.59
7.2.130.0150.01518.39
7.2.120.0100.01318.55
7.2.110.0240.01718.32
7.2.100.0070.01818.51
7.2.90.0210.01018.45
7.2.80.0200.00718.89
7.2.70.0270.00418.73
7.2.60.0160.00618.60
7.2.50.0110.01518.71
7.2.40.0410.00718.80
7.2.30.0120.01418.55
7.2.20.0140.01218.68
7.2.10.0480.00718.34
7.2.00.0110.01120.13
7.1.250.0100.01017.65
7.1.70.0030.00619.19
7.1.60.0100.01719.82
7.1.50.0070.01718.50
7.1.00.0100.07024.24
7.0.200.0150.00318.63
7.0.140.0000.07024.24
7.0.60.0100.07721.57
7.0.50.0030.07019.52
7.0.40.0070.04320.21
7.0.30.0500.07320.30
7.0.20.0300.07720.12
7.0.10.0170.04720.24
7.0.00.0100.08720.07
5.6.280.0030.08022.81
5.6.210.0070.06722.09
5.6.200.0130.05019.72
5.6.190.0100.06021.97
5.6.180.0100.08021.93
5.6.170.0230.04021.98
5.6.160.0070.08721.97
5.6.150.0070.04719.79
5.6.140.0170.04019.78
5.6.130.0100.08019.78
5.6.120.0030.08322.54
5.6.110.0100.08722.67
5.6.100.0030.09022.57
5.6.90.0070.08322.57
5.6.80.0100.05722.00
5.6.70.0370.07321.95
5.5.350.0030.08322.00
5.5.340.0070.04719.51
5.5.330.0030.07721.59
5.5.320.0330.08321.75
5.5.310.0170.04721.68
5.5.300.0070.09019.48
5.5.290.0000.04719.55
5.5.280.0030.04022.32
5.5.270.0130.03322.46
5.5.260.0130.06722.52
5.5.250.0030.09722.25
5.5.240.0170.06721.60
5.4.450.0500.05320.91
5.4.440.1200.04320.91
5.4.430.0400.05021.05
5.4.420.0330.03320.81
5.4.410.0100.05720.23
5.4.400.0070.06020.29
5.4.390.0270.03719.97
5.4.380.0130.08020.33
5.4.370.0370.05720.11
5.4.360.0270.05720.27
5.4.350.0300.06020.29
5.4.340.0500.04320.06
5.4.320.0080.04614.06
5.4.310.0030.04314.06
5.4.300.0050.04014.05
5.4.290.0070.03914.05
5.4.280.0100.03413.95
5.4.270.0080.03613.95
5.4.260.0070.04413.95
5.4.250.0090.04413.95
5.4.240.0050.04513.95
5.4.230.0070.03913.94
5.4.220.0090.03613.95
5.4.210.0070.03713.95
5.4.200.0100.04513.94
5.4.190.0030.04413.94
5.4.180.0040.04013.94
5.4.170.0090.05213.93
5.4.160.0350.09013.93
5.4.150.0160.04613.93
5.4.140.0160.04513.61
5.4.130.0200.04213.60
5.4.120.0190.04313.56
5.4.110.0180.04213.55
5.4.100.0120.04913.55
5.4.90.0200.04213.55
5.4.80.0220.06913.55
5.4.70.0120.04813.55
5.4.60.0190.04113.54
5.4.50.0180.04213.54
5.4.40.0170.04213.53
5.4.30.0310.09013.53
5.4.20.0200.03913.53
5.4.10.0170.04313.53
5.4.00.0140.04613.01
5.3.290.0040.04514.75
5.3.280.0050.04214.68
5.3.270.0160.04914.70
5.3.260.0190.04614.70
5.3.250.0250.07014.70
5.3.240.0170.04814.70
5.3.230.0210.04514.69
5.3.220.0250.04314.66
5.3.210.0160.05014.67
5.3.200.0180.05114.66
5.3.190.0210.04514.66
5.3.180.0330.06114.66
5.3.170.0160.04914.66
5.3.160.0240.04014.66
5.3.150.0180.04714.66
5.3.140.0300.06514.65
5.3.130.0210.04414.64
5.3.120.0230.04814.64
5.3.110.0150.05414.64
5.3.100.0160.04914.14
5.3.90.0130.05014.12
5.3.80.0200.04514.10
5.3.70.0180.04614.10
5.3.60.0340.09214.08
5.3.50.0190.04414.04
5.3.40.0140.05014.04
5.3.30.0140.04814.03
5.3.20.0150.04913.78
5.3.10.0220.04113.73
5.3.00.0170.04513.70
5.2.170.0160.0319.23
5.2.160.0120.0349.23
5.2.150.0260.0519.23
5.2.140.0100.0379.23
5.2.130.0110.0359.19
5.2.120.0140.0329.19
5.2.110.0100.0389.19
5.2.100.0130.0329.20
5.2.90.0230.0539.19
5.2.80.0150.0319.18
5.2.70.0130.0369.18
5.2.60.0130.0339.13
5.2.50.0180.0289.11
5.2.40.0110.0359.08
5.2.30.0080.0389.05
5.2.20.0100.0379.05
5.2.10.0130.0338.96
5.2.00.0120.0348.81
5.1.60.0090.0308.09
5.1.50.0130.0298.09
5.1.40.0070.0328.08
5.1.30.0140.0288.42
5.1.20.0100.0328.46
5.1.10.0100.0328.18
5.1.00.0100.0308.18
5.0.50.0080.0256.65
5.0.40.0100.0216.50
5.0.30.0070.0376.33
5.0.20.0100.0216.29
5.0.10.0110.0206.27
5.0.00.0090.0356.26
4.4.90.0050.0204.78
4.4.80.0060.0204.75
4.4.70.0110.0174.76
4.4.60.0060.0194.75
4.4.50.0140.0424.77
4.4.40.0080.0274.71
4.4.30.0050.0204.76
4.4.20.0110.0164.84
4.4.10.0060.0194.85
4.4.00.0070.0284.76
4.3.110.0050.0194.66
4.3.100.0110.0444.67
4.3.90.0070.0174.63
4.3.80.0080.0264.59
4.3.70.0070.0164.63
4.3.60.0050.0194.63
4.3.50.0060.0204.63
4.3.40.0050.0284.54
4.3.30.0040.0193.30
4.3.20.0050.0183.30
4.3.10.0060.0163.25
4.3.00.0270.01315.17

preferences:
30.58 ms | 401 KiB | 5 Q