3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { public $arr = ["rose"=>"pink", "violet"=>"purple", "grass"=>"green"]; } $obj = new myClass; $flowers = [0=>"rose",1=>"violet"]; $closure = function( $item ){ return $this->arr[$item]; }; foreach ($flowers as $key => $flower){ $color = $closure->call($obj,$flower); echo ucfirst("{$flower}s are $color"); echo ($key == 0)? ",\n" : " ...\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)
8.3.70.0110.00716.63
8.3.60.0070.00716.63
8.3.50.0080.01121.99
8.3.40.0040.01118.70
8.3.30.0060.00918.75
8.3.20.0000.00720.13
8.3.10.0030.00718.90
8.3.00.0040.00423.37
8.2.190.0110.01118.29
8.2.180.0140.00716.60
8.2.170.0120.00322.96
8.2.160.0000.01421.95
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0040.00420.59
8.2.120.0000.00826.35
8.2.110.0000.00919.24
8.2.100.0080.00418.03
8.2.90.0090.00019.32
8.2.80.0000.00817.97
8.2.70.0000.00917.38
8.2.60.0000.00818.05
8.2.50.0030.00618.09
8.2.40.0040.00422.11
8.2.30.0040.00419.41
8.2.20.0080.00017.80
8.2.10.0000.00718.02
8.2.00.0000.00718.10
8.1.280.0090.00925.92
8.1.270.0000.00722.20
8.1.260.0040.00428.09
8.1.250.0050.00228.09
8.1.240.0100.00022.27
8.1.230.0070.00317.77
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0040.00417.36
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0000.00818.51
8.1.160.0030.00520.77
8.1.150.0070.00318.93
8.1.140.0030.00619.45
8.1.130.0000.00717.75
8.1.120.0040.00417.47
8.1.110.0040.00417.39
8.1.100.0030.00517.51
8.1.90.0050.00217.49
8.1.80.0040.00417.29
8.1.70.0000.00717.48
8.1.60.0070.00017.47
8.1.50.0060.00317.39
8.1.40.0000.00817.51
8.1.30.0040.00417.70
8.1.20.0040.00417.67
8.1.10.0030.00517.46
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.34
8.0.270.0060.00317.31
8.0.260.0000.00717.23
8.0.250.0030.00516.88
8.0.240.0000.00616.84
8.0.230.0030.00316.93
8.0.220.0000.01016.87
8.0.210.0000.00816.83
8.0.200.0030.00316.95
8.0.190.0040.00416.85
8.0.180.0040.00416.77
8.0.170.0050.00316.93
8.0.160.0000.00716.80
8.0.150.0040.00416.93
8.0.140.0030.00616.80
8.0.130.0050.00013.35
8.0.120.0050.00316.79
8.0.110.0070.00016.93
8.0.100.0030.00316.78
8.0.90.0030.00616.88
8.0.80.0120.00316.83
8.0.70.0000.00716.94
8.0.60.0040.00416.95
8.0.50.0000.00716.73
8.0.30.0070.01417.25
8.0.20.0110.01017.40
8.0.10.0030.00516.96
8.0.00.0100.00816.70
7.4.330.0000.00516.69
7.4.320.0000.00616.52
7.4.300.0000.00716.49
7.4.290.0070.00016.54
7.4.280.0000.00716.54
7.4.270.0030.00316.40
7.4.260.0060.00016.39
7.4.250.0000.00716.50
7.4.240.0000.00816.45
7.4.230.0000.00816.37
7.4.220.0070.01016.60
7.4.210.0070.00716.46
7.4.200.0030.00316.48
7.4.160.0040.01216.57
7.4.150.0130.00317.40
7.4.140.0150.00717.86
7.4.130.0100.00816.53
7.4.120.0070.01016.45
7.4.110.0110.00516.48
7.4.100.0060.01016.49
7.4.90.0120.00616.48
7.4.80.0090.01219.39
7.4.70.0060.00916.40
7.4.60.0130.00416.56
7.4.50.0040.01116.41
7.4.40.0090.00816.55
7.4.30.0140.00316.57
7.4.00.0030.01414.92
7.3.330.0050.00013.35
7.3.320.0050.00013.37
7.3.310.0030.00316.17
7.3.300.0000.00716.31
7.3.290.0100.00516.36
7.3.280.0100.00716.32
7.3.270.0140.00317.40
7.3.260.0120.01216.38
7.3.250.0090.00916.28
7.3.240.0080.01216.44
7.3.230.0060.01016.41
7.3.210.0150.00616.36
7.3.200.0120.00319.39
7.3.190.0120.00616.36
7.3.180.0060.01016.26
7.3.170.0070.01016.33
7.3.160.0090.01316.56
7.2.330.0120.01216.84
7.2.320.0090.00816.84
7.2.310.0090.01016.60
7.2.300.0160.00016.50
7.2.290.0080.00816.88
7.2.80.0030.01016.75
7.2.60.0000.01417.01
7.1.200.0080.00015.75
7.1.70.0040.00417.22
7.1.60.0100.01619.40
7.1.50.0070.01417.13
7.1.00.0030.07722.42
7.0.200.0320.00914.67
7.0.60.0270.06321.73
7.0.50.0070.08317.95
7.0.40.0100.08319.96
7.0.30.0400.07320.20
7.0.20.0230.05020.23
7.0.10.0070.05320.07
7.0.00.0030.08720.17
5.6.280.0100.06720.79
5.6.210.0100.05320.53
5.6.200.0070.07318.19
5.6.190.0030.08720.49
5.6.180.0400.06720.67
5.6.170.0230.08020.55
5.6.160.0030.04320.55
5.6.150.0030.08318.19
5.6.140.0070.08318.19
5.6.130.0130.05018.26
5.6.120.0100.08021.00
5.6.110.0100.08321.14
5.6.100.0230.07321.14
5.6.90.0030.05321.13
5.6.80.0070.04320.38
5.5.350.0200.07720.30
5.5.340.0130.04717.96
5.5.330.0130.05720.40
5.5.320.0600.05720.41
5.5.310.0270.06020.51
5.5.300.0130.04317.97
5.5.290.0100.07717.96
5.5.280.0100.05720.66
5.5.270.0030.05320.68
5.5.260.0070.07020.65
5.5.250.0070.08020.69
5.5.240.0270.05020.36

preferences:
20.07 ms | 401 KiB | 5 Q