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.4.00.0110.01116.21
7.3.120.0120.00616.41
7.3.110.0180.00416.38
7.3.100.0130.00316.22
7.3.90.0090.00616.18
7.3.80.0040.01116.47
7.3.70.0000.01516.21
7.3.60.0070.01316.34
7.3.50.0070.00716.31
7.3.40.0120.00016.14
7.3.30.0030.00916.39
7.3.20.0030.00918.65
7.3.10.0030.01018.68
7.3.00.0000.01618.36
7.2.250.0070.01516.29
7.2.240.0030.02116.55
7.2.230.0060.01316.63
7.2.220.0030.01216.79
7.2.210.0070.01116.27
7.2.200.0080.00816.79
7.2.190.0060.01016.36
7.2.180.0100.01016.60
7.2.170.0030.01016.38
7.2.00.0070.00721.24
7.1.330.0030.01317.73
7.1.320.0160.00617.93
7.1.310.0060.00917.64
7.1.300.0030.00917.78
7.1.290.0000.01417.71
7.1.280.0070.00717.75
7.1.270.0030.01317.70
7.1.260.0040.01117.95
7.1.70.0030.01019.25
7.1.60.0070.02019.31
7.1.50.0030.01018.90
7.1.00.0070.06024.45
7.0.200.0510.00316.77
7.0.140.0030.07724.04
7.0.120.0070.07024.24
7.0.60.0270.07321.85
7.0.50.0230.03719.54
7.0.40.0130.07719.98
7.0.30.0330.07320.26
7.0.20.0270.08720.20
7.0.10.0300.07320.02
7.0.00.0330.06020.02
5.6.280.0000.08022.86
5.6.210.0100.05722.13
5.6.200.0070.04019.72
5.6.190.0200.05022.02
5.6.180.0270.08722.00
5.6.170.0230.08321.94
5.6.160.0330.05721.96
5.6.150.0230.08021.78
5.6.140.0230.05721.85
5.6.130.0300.06721.76
5.6.120.0270.08721.88
5.6.110.0270.07321.75
5.6.100.0130.05321.87
5.6.90.0230.08721.92
5.6.80.0300.04021.14
5.6.70.0200.05320.98
5.6.60.0170.06021.00
5.6.50.0170.04321.00
5.6.40.0130.04721.10
5.6.30.0130.04721.09
5.6.20.0200.08020.98
5.6.10.0230.05321.11
5.6.00.0230.08021.20
5.5.350.0170.07021.94
5.5.340.0130.03319.36
5.5.330.0170.06721.76
5.5.320.0270.07721.73
5.5.310.0170.07721.73
5.5.300.0170.05021.59
5.5.290.0200.06721.43
5.5.280.0300.08021.56
5.5.270.0200.04321.41
5.5.260.0230.04021.41
5.5.250.0270.06321.40
5.5.240.0230.04020.95
5.5.230.0200.05021.02
5.5.220.0270.07720.80
5.5.210.0200.04020.80
5.5.200.0200.04320.87
5.5.190.0130.04720.77
5.5.180.0170.04321.00
5.5.160.0270.04020.94
5.5.150.0170.07720.93
5.5.140.0230.04321.09
5.5.130.0200.07021.09
5.5.120.0300.07320.76
5.5.110.0170.04320.83
5.5.100.0200.06320.71
5.5.90.0230.04720.84
5.5.80.0170.04720.66
5.5.70.0300.03020.81
5.5.60.0170.07020.69
5.5.50.0230.07320.89
5.5.40.0270.07720.73
5.5.30.0200.05020.77
5.5.20.0330.02720.77
5.5.10.0230.08320.67
5.5.00.0200.08020.86
5.4.450.0200.06020.88
5.4.440.0200.08320.84
5.4.430.0200.03720.84
5.4.420.0100.06321.05
5.4.410.0200.07720.60
5.4.400.0100.04720.60
5.4.390.0300.07320.49
5.4.380.0170.04020.41
5.4.370.0230.03720.64
5.4.360.0230.04320.41
5.4.350.0200.03720.36
5.4.340.0300.05720.64
5.4.320.0230.07720.36
5.4.310.0330.04720.64
5.4.300.0200.05720.74
5.4.290.0130.04320.73
5.4.280.0230.05020.52
5.4.270.0200.07720.48
5.4.260.0170.07020.38
5.4.250.0230.04320.51
5.4.240.0270.07720.33
5.4.230.0170.04720.47
5.4.220.0270.06720.47
5.4.210.0230.07720.73
5.4.200.0270.07320.40
5.4.190.0230.03320.50
5.4.180.0230.04020.37
5.4.170.0200.04320.71
5.4.160.0270.04320.55
5.4.150.0270.06720.71
5.4.140.0200.08017.88
5.4.130.0170.08018.02
5.4.120.0300.07017.82
5.4.110.0200.06318.01
5.4.100.0270.04017.94
5.4.90.0170.05018.07
5.4.80.0330.05017.81
5.4.70.0200.04017.78
5.4.60.0230.06017.94
5.4.50.0270.06017.89
5.4.40.0330.06317.93
5.4.30.0130.07018.00
5.4.20.0230.07017.83
5.4.10.0270.07317.75
5.4.00.0170.04017.45
5.3.290.0170.04316.54
5.3.280.0270.05316.48
5.3.270.0230.08316.41
5.3.260.0200.05016.48
5.3.250.0230.07716.54
5.3.240.0230.04716.41
5.3.230.0230.08016.44
5.3.220.0230.07716.50
5.3.210.0200.07716.50
5.3.200.0300.05316.45
5.3.190.0230.08016.43
5.3.180.0270.08016.59
5.3.170.0270.05016.52
5.3.160.0330.07016.54
5.3.150.0270.06316.49
5.3.140.0170.05016.48
5.3.130.0200.05716.34
5.3.120.0270.07316.43
5.3.110.0270.07016.57
5.3.100.0230.06315.95
5.3.90.0270.06315.81
5.3.80.0230.05315.80
5.3.70.0230.06315.80
5.3.60.0170.04715.85
5.3.50.0300.04315.74
5.3.40.0270.03015.73
5.3.30.0230.06015.72
5.3.20.0270.07315.50
5.3.10.0270.06715.48
5.3.00.0200.04015.50
5.2.170.0230.05312.63
5.2.160.0230.05712.63
5.2.150.0170.06312.63
5.2.140.0130.06312.63
5.2.130.0270.04712.63
5.2.120.0230.03312.63
5.2.110.0230.03312.63
5.2.100.0130.03012.63
5.2.90.0270.05012.63
5.2.80.0200.05712.63
5.2.70.0230.05312.63
5.2.60.0200.03712.63
5.2.50.0230.04312.63
5.2.40.0200.05012.63
5.2.30.0270.05012.63
5.2.20.0170.03712.63
5.2.10.0130.06312.63
5.2.00.0200.05312.63
5.1.60.0100.04012.63
5.1.50.0200.01712.63
5.1.40.0170.04712.63
5.1.30.0170.03712.63
5.1.20.0170.05312.63
5.1.10.0170.05012.63
5.1.00.0200.04312.63
5.0.50.0100.02712.63
5.0.40.0030.03712.63
5.0.30.0170.06012.63
5.0.20.0070.04012.63
5.0.10.0070.03312.63
5.0.00.0100.04312.63
4.4.90.0100.01712.63
4.4.80.0100.02312.63
4.4.70.0130.01312.63
4.4.60.0070.04012.63
4.4.50.0070.03712.63
4.4.40.0070.04312.63
4.4.30.0070.02712.63
4.4.20.0030.03012.63
4.4.10.0070.03312.63
4.4.00.0130.04012.63
4.3.110.0130.02712.63
4.3.100.0030.02712.63
4.3.90.0070.02312.63
4.3.80.0130.03712.63
4.3.70.0100.02312.63
4.3.60.0070.02012.63
4.3.50.0030.04012.63
4.3.40.0100.05312.63
4.3.30.0070.03312.63
4.3.20.0030.03012.63
4.3.10.0030.03312.63
4.3.00.0030.03712.63

preferences:
28.11 ms | 401 KiB | 5 Q