3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { public $arr = ["rose"=>"red", "violet"=>"blue", "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.60.0080.00816.75
8.3.50.0100.00521.93
8.3.40.0140.00018.93
8.3.30.0120.00318.79
8.3.20.0000.00720.22
8.3.10.0030.00718.63
8.3.00.0070.00023.54
8.2.180.0070.00716.63
8.2.170.0040.01122.96
8.2.160.0130.00022.13
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00520.77
8.2.120.0000.00726.35
8.2.110.0110.00021.11
8.2.100.0150.00018.03
8.2.90.0000.00817.88
8.2.80.0040.00418.77
8.2.70.0030.00618.05
8.2.60.0000.00817.63
8.2.50.0050.00318.09
8.2.40.0060.00322.29
8.2.30.0070.00019.38
8.2.20.0030.00617.87
8.2.10.0000.00718.20
8.2.00.0000.00718.12
8.1.280.0070.00725.92
8.1.270.0050.00322.23
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00021.24
8.1.230.0110.00019.06
8.1.220.0040.00417.77
8.1.210.0030.00518.77
8.1.200.0030.00517.36
8.1.190.0080.00017.23
8.1.180.0000.00718.10
8.1.170.0050.00318.71
8.1.160.0000.00720.79
8.1.150.0000.01018.89
8.1.140.0040.00419.57
8.1.130.0070.00017.62
8.1.120.0000.00717.35
8.1.110.0040.00417.42
8.1.100.0000.00717.36
8.1.90.0050.00317.45
8.1.80.0050.00217.53
8.1.70.0040.00417.30
8.1.60.0030.00617.59
8.1.50.0040.00417.50
8.1.40.0030.00517.50
8.1.30.0030.00617.63
8.1.20.0040.00417.60
8.1.10.0050.00317.50
8.1.00.0040.00417.45
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.49
8.0.270.0000.00717.17
8.0.260.0060.00017.16
8.0.250.0080.00016.95
8.0.240.0070.00016.90
8.0.230.0030.00316.88
8.0.220.0060.00316.98
8.0.210.0070.00016.88
8.0.200.0000.00816.91
8.0.190.0040.00416.89
8.0.180.0040.00417.00
8.0.170.0070.00016.88
8.0.160.0040.00416.91
8.0.150.0000.00716.89
8.0.140.0050.00516.84
8.0.130.0000.00713.33
8.0.120.0050.00216.89
8.0.110.0070.00016.97
8.0.100.0040.00416.73
8.0.90.0000.00816.94
8.0.80.0170.00316.98
8.0.70.0000.00717.00
8.0.60.0060.00316.97
8.0.50.0030.00616.77
8.0.30.0120.00617.12
8.0.20.0100.00917.40
8.0.10.0040.00416.89
8.0.00.0100.00616.86
7.4.330.0000.00516.84
7.4.320.0060.00016.39
7.4.300.0060.00016.53
7.4.290.0070.00016.48
7.4.280.0020.00516.45
7.4.270.0030.00316.48
7.4.260.0050.00316.45
7.4.250.0040.00416.49
7.4.240.0000.00716.49
7.4.230.0050.00316.52
7.4.220.0070.01116.52
7.4.210.0070.00716.56
7.4.200.0000.00716.33
7.4.160.0080.00816.66
7.4.150.0130.00317.40
7.4.140.0090.00817.86
7.4.130.0130.00716.49
7.4.120.0050.01316.49
7.4.110.0080.00816.50
7.4.100.0120.00916.71
7.4.90.0070.01016.45
7.4.80.0080.01119.39
7.4.70.0100.01316.63
7.4.60.0090.00916.52
7.4.50.0030.01316.58
7.4.40.0080.00816.60
7.4.30.0100.01016.49
7.4.00.0090.00615.01
7.3.330.0030.00313.29
7.3.320.0060.00013.42
7.3.310.0030.00316.52
7.3.300.0030.00316.43
7.3.290.0070.00816.40
7.3.280.0080.01016.41
7.3.270.0030.01317.40
7.3.260.0170.00016.72
7.3.250.0140.00416.49
7.3.240.0080.01016.49
7.3.230.0110.00716.63
7.3.210.0120.00416.42
7.3.200.0040.01319.39
7.3.190.0080.00816.48
7.3.180.0100.00716.52
7.3.170.0100.00716.63
7.3.160.0090.00616.71
7.3.10.0070.00716.43
7.3.00.0000.01716.59
7.2.330.0090.00916.64
7.2.320.0070.01016.41
7.2.310.0090.00916.54
7.2.300.0070.01316.50
7.2.290.0100.00716.68
7.2.130.0080.00816.74
7.2.120.0100.01016.50
7.2.110.0090.00916.40
7.2.100.0130.00616.42
7.2.90.0040.01416.45
7.2.80.0160.00316.66
7.2.70.0160.01116.63
7.2.60.0100.01216.93
7.2.50.0060.01416.72
7.2.40.0110.01116.67
7.2.30.0100.01316.75
7.2.20.0140.00716.20
7.2.10.0120.00016.64
7.2.00.0070.00918.17
7.1.250.0120.00815.38
7.1.200.0060.00615.91
7.1.100.0050.00518.38
7.1.70.0030.00317.09
7.1.60.0130.01319.40
7.1.50.0100.01017.09
7.1.00.0000.08022.45
7.0.200.0440.00714.58
7.0.60.0000.06721.83
7.0.50.0100.08717.89
7.0.40.0230.07320.09
7.0.30.0200.07320.26
7.0.20.0430.07320.05
7.0.10.0100.03720.20
7.0.00.0000.04320.07
5.6.280.0000.03320.90
5.6.210.0100.08320.49
5.6.200.0000.05718.34
5.6.190.0000.09020.39
5.6.180.0370.07720.60
5.6.170.0230.05020.71
5.6.160.0030.04720.41
5.6.150.0070.08018.14
5.6.140.0030.08318.28
5.6.130.0070.03718.27
5.6.120.0100.04021.10
5.6.110.0170.07021.00
5.6.100.0030.04721.09
5.6.90.0130.09021.11
5.6.80.0100.07720.43
5.5.350.0100.08020.33
5.5.340.0030.03717.99
5.5.330.0100.06720.32
5.5.320.0600.05720.35
5.5.310.0270.05720.35
5.5.300.0130.07317.95
5.5.290.0070.07318.00
5.5.280.0230.06320.85
5.5.270.0100.09020.76
5.5.260.0030.06320.90
5.5.250.0030.04020.56
5.5.240.0300.07020.04

preferences:
63.92 ms | 401 KiB | 5 Q