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(){ return $this; $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.10.0060.01316.17
7.4.00.0100.00816.12
7.3.130.0100.01015.90
7.3.120.0050.01415.85
7.3.110.0050.01215.99
7.3.100.0100.00516.02
7.3.90.0120.00515.87
7.3.80.0060.00615.96
7.3.70.0020.01315.90
7.3.60.0050.01015.88
7.3.50.0090.00615.88
7.3.40.0030.01015.74
7.3.30.0050.00815.81
7.3.20.0070.00716.74
7.3.10.0080.01116.44
7.3.00.0080.00716.59
7.2.260.0080.01215.82
7.2.250.0050.01416.02
7.2.240.0120.00816.14
7.2.230.0060.01116.21
7.2.220.0030.01216.23
7.2.210.0020.01316.06
7.2.200.0070.00416.06
7.2.190.0050.01116.17
7.2.180.0090.00916.23
7.2.170.0030.01216.08
7.2.160.0110.00616.30
7.2.150.0060.01017.04
7.2.140.0100.00317.09
7.2.130.0130.00416.84
7.2.120.0130.00316.90
7.2.110.0030.01616.65
7.2.100.0110.00916.63
7.2.90.0020.01516.83
7.2.80.0050.01316.87
7.2.70.0120.00416.83
7.2.60.0090.00916.88
7.2.50.0090.00816.98
7.2.40.0000.01416.70
7.2.30.0080.00816.77
7.2.20.0000.01516.88
7.2.10.0120.00516.95
7.2.00.0080.00817.79
7.1.330.0030.01215.76
7.1.320.0050.00915.96
7.1.310.0030.00916.04
7.1.300.0020.01415.91
7.1.290.0070.00715.96
7.1.280.0060.00815.85
7.1.270.0040.01115.75
7.1.260.0100.00615.71
7.1.250.0040.00915.75
7.1.240.0090.00615.96
7.1.230.0120.00315.58
7.1.220.0060.00616.01
7.1.210.0030.01315.96
7.1.200.0080.00315.88
7.1.190.0030.01015.85
7.1.180.0090.00615.53
7.1.170.0100.00715.79
7.1.160.0030.00915.85
7.1.150.0080.00415.75
7.1.140.0060.00615.63
7.1.130.0040.01115.97
7.1.120.0090.00915.74
7.1.110.0050.00415.80
7.1.100.0000.01015.91
7.1.90.0030.01215.68
7.1.80.0100.00615.68
7.1.70.0050.01216.46
7.1.60.0040.01217.69
7.1.50.0110.00816.55
7.1.40.0040.01116.07
7.1.30.0100.00615.79
7.1.20.0090.00615.95
7.1.10.0030.01515.98
7.1.00.0110.03819.20
7.0.330.0030.00715.36
7.0.320.0050.00515.49
7.0.310.0060.00315.16
7.0.300.0060.00615.50
7.0.290.0100.00615.59
7.0.280.0030.00615.53
7.0.270.0050.00515.33
7.0.260.0090.00715.43
7.0.250.0090.00315.31
7.0.240.0100.00615.61
7.0.230.0110.00315.48
7.0.220.0070.01015.34
7.0.210.0030.01315.71
7.0.200.0000.01416.24
7.0.190.0030.01015.68
7.0.180.0060.00915.65
7.0.170.0060.00615.49
7.0.160.0060.00815.50
7.0.150.0030.01315.29
7.0.140.0080.03818.87
7.0.130.0040.00815.68
7.0.120.0000.01315.62
7.0.110.0000.01715.74
7.0.100.0070.00715.33
7.0.90.0040.00815.61
7.0.80.0040.00815.48
7.0.70.0060.00915.33
7.0.60.0060.04318.11
7.0.50.0060.03017.14
7.0.40.0070.04816.78
7.0.30.0190.02316.91
7.0.20.0080.03817.03
7.0.10.0050.05016.95
7.0.00.0080.04016.90
5.6.400.0070.00715.11
5.6.390.0090.00315.27
5.6.380.0110.00715.35
5.6.370.0090.00615.62
5.6.360.0080.00815.52
5.6.350.0030.01015.23
5.6.340.0040.01415.46
5.6.330.0040.01215.25
5.6.320.0090.00915.46
5.6.310.0070.01015.60
5.6.300.0000.01815.14
5.6.290.0030.01715.43
5.6.280.0110.03818.63
5.6.270.0120.00015.16
5.6.260.0110.00415.82
5.6.250.0030.01415.20
5.6.240.0090.00615.38
5.6.230.0070.00415.52
5.6.220.0030.01015.14
5.6.210.0070.04418.31
5.6.200.0070.04517.05
5.6.190.0070.02918.12
5.6.180.0100.02518.23
5.6.170.0120.03018.20
5.6.160.0050.05018.07
5.6.150.0020.04017.22
5.6.140.0070.02517.13
5.6.130.0080.02417.22
5.6.120.0060.03518.46
5.6.110.0050.02318.48
5.6.100.0070.04018.58
5.6.90.0090.04618.53
5.6.80.0160.01618.18
5.6.70.2250.02518.12
5.6.60.0070.01015.36
5.6.50.0080.00815.13
5.6.40.0060.01614.92
5.6.30.0070.01115.01
5.6.20.0140.00715.02
5.6.10.0110.00915.14
5.6.00.0070.01014.98
5.5.380.0030.01015.17
5.5.370.0030.00915.41
5.5.360.0130.00315.20
5.5.350.0100.04618.29
5.5.340.0140.02416.84
5.5.330.0050.04518.03
5.5.320.0220.02518.17
5.5.310.0160.02317.91
5.5.300.0120.04016.95
5.5.290.0070.04516.87
5.5.280.0080.04818.46
5.5.270.0100.02218.23
5.5.260.0070.04018.45
5.5.250.0030.03118.31
5.5.240.0110.03617.98
5.5.230.0000.01015.10
5.5.220.0060.01315.14
5.5.210.0040.01214.93
5.5.200.0000.01715.31
5.5.190.0030.01315.06
5.5.180.0100.00615.11
5.5.170.0030.01015.22
5.5.160.0030.01315.05
5.5.150.0040.01515.25
5.5.140.0000.01414.89
5.5.130.0060.01015.08
5.5.120.0060.01315.21
5.5.110.0040.01115.13
5.5.100.0130.00315.04
5.5.90.0040.00815.09
5.5.80.0120.00015.19
5.5.70.0100.00714.98
5.5.60.0030.01314.89
5.5.50.0030.01615.19
5.5.40.0140.00415.18
5.5.30.0070.01015.40
5.5.20.0030.01315.23
5.5.10.0070.01115.10
5.5.00.0120.00414.77
5.4.450.0110.03315.87
5.4.440.0150.03515.96
5.4.430.0160.04216.05
5.4.420.0170.03415.91
5.4.410.0130.03315.84
5.4.400.0160.03015.77
5.4.390.0160.03415.99
5.4.380.0130.03315.54
5.4.370.0180.03815.76
5.4.360.0180.03015.53
5.4.350.0190.03815.69
5.4.340.0320.04015.74
5.4.330.0060.00311.69
5.4.320.0050.02312.55
5.4.310.0100.02012.36
5.4.300.0050.02712.51
5.4.290.0060.02212.47
5.4.280.0040.02412.47
5.4.270.0080.02212.40
5.4.260.0080.01912.57
5.4.250.0060.02512.47
5.4.240.0080.02512.49
5.4.230.0020.02612.49
5.4.220.0090.02012.40
5.4.210.0090.02212.51
5.4.200.0030.02512.45
5.4.190.0090.02312.44
5.4.180.0040.02412.45
5.4.170.0190.05012.43
5.4.160.0140.02712.54
5.4.150.0250.04412.36
5.4.140.0210.05412.31
5.4.130.0180.05512.21
5.4.120.0100.03112.25
5.4.110.0220.04612.21
5.4.100.0210.04912.23
5.4.90.0090.02812.33
5.4.80.0140.05212.25
5.4.70.0100.02512.26
5.4.60.0160.05212.35
5.4.50.0080.02712.10
5.4.40.0190.05012.27
5.4.30.0160.05412.36
5.4.20.0120.02512.28
5.4.10.0180.03912.26
5.4.00.0170.03612.06
5.3.290.0090.02112.87
5.3.280.0050.02612.74
5.3.270.0160.02812.72
5.3.260.0250.04912.83
5.3.250.0070.03112.81
5.3.240.0210.04012.63
5.3.230.0080.03112.72
5.3.220.0160.03812.66
5.3.210.0080.03112.66
5.3.200.0160.04012.68
5.3.190.0080.03012.69
5.3.180.0140.03812.79
5.3.170.0210.04712.76
5.3.160.0150.02512.76
5.3.150.0110.04012.64
5.3.140.0160.05012.70
5.3.130.0200.04812.73
5.3.120.0240.04412.73
5.3.110.0110.02812.66
5.3.100.0200.05012.47
5.3.90.0210.04812.54
5.3.80.0120.02612.36
5.3.70.0080.03012.40
5.3.60.0100.02712.31
5.3.50.0120.04012.39
5.3.40.0100.02912.34
5.3.30.0090.02912.29
5.3.20.0120.02712.26
5.3.10.0160.04112.15
5.3.00.0190.05312.13
5.2.170.0150.0639.23
5.2.160.0120.0349.23
5.2.150.0150.0359.23
5.2.140.0190.0589.23
5.2.130.0310.0759.19
5.2.120.0150.0359.18
5.2.110.0120.0379.20
5.2.100.0340.0779.20
5.2.90.0140.0359.19
5.2.80.0190.0309.18
5.2.70.0290.0799.18
5.2.60.0350.0739.14
5.2.50.0180.0329.11
5.2.40.0140.0349.08
5.2.30.0120.0349.05
5.2.20.0220.0569.05
5.2.10.0220.0568.95
5.2.00.0110.0338.82
5.1.60.0180.0528.09
5.1.50.0120.0298.09
5.1.40.0390.0618.08
5.1.30.0130.0298.42
5.1.20.0330.0708.46
5.1.10.0330.0718.18
5.1.00.0080.0338.18
5.0.50.0100.0246.65
5.0.40.0070.0266.51
5.0.30.0200.0856.32
5.0.20.0090.0236.29
5.0.10.0290.0676.27
5.0.00.0090.0376.26
4.4.90.0090.0164.78
4.4.80.0080.0174.75
4.4.70.0060.0194.75
4.4.60.0230.0624.75
4.4.50.0120.0134.77
4.4.40.0270.0714.70
4.4.30.0090.0164.76
4.4.20.0290.0564.85
4.4.10.0110.0144.85
4.4.00.0080.0274.76
4.3.110.0090.0164.67
4.3.100.0060.0184.67
4.3.90.0050.0194.63
4.3.80.0080.0274.58
4.3.70.0060.0204.63
4.3.60.0210.0664.63
4.3.50.0080.0164.63
4.3.40.0240.0714.54
4.3.30.0070.0173.31
4.3.20.0050.0193.29
4.3.10.0050.0183.25
4.3.00.0030.0207.81

preferences:
43.04 ms | 401 KiB | 5 Q