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 ){ //$arr = $this->arr; 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.0070.00718.30
8.3.50.0150.00018.17
8.3.40.0070.00718.84
8.3.30.0090.00618.67
8.3.20.0070.00020.38
8.3.10.0080.00318.80
8.3.00.0080.00023.66
8.2.180.0090.00925.92
8.2.170.0120.00322.96
8.2.160.0040.01122.20
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00020.85
8.2.120.0040.00426.35
8.2.110.0030.00719.39
8.2.100.0090.00317.93
8.2.90.0000.00819.30
8.2.80.0080.00017.97
8.2.70.0060.00317.75
8.2.60.0040.00417.80
8.2.50.0080.00018.09
8.2.40.0040.00422.29
8.2.30.0070.00019.46
8.2.20.0000.00817.62
8.2.10.0080.00018.23
8.2.00.0040.00418.13
8.1.280.0030.01725.92
8.1.270.0060.00322.19
8.1.260.0060.00328.09
8.1.250.0000.00728.09
8.1.240.0110.00022.07
8.1.230.0000.01117.76
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0080.00017.48
8.1.190.0040.00417.25
8.1.180.0000.00818.10
8.1.170.0040.00418.55
8.1.160.0040.00420.77
8.1.150.0070.00418.88
8.1.140.0040.00419.48
8.1.130.0030.00317.64
8.1.120.0000.00717.48
8.1.110.0040.00417.53
8.1.100.0000.00817.44
8.1.90.0080.00017.48
8.1.80.0030.00517.47
8.1.70.0070.00017.31
8.1.60.0040.00417.59
8.1.50.0080.00017.44
8.1.40.0080.00017.55
8.1.30.0060.00317.63
8.1.20.0060.00317.59
8.1.10.0040.00417.48
8.1.00.0030.00517.52
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0000.00718.49
8.0.270.0000.00817.16
8.0.260.0000.00717.30
8.0.250.0000.00716.94
8.0.240.0030.00316.86
8.0.230.0070.00016.92
8.0.220.0030.00616.91
8.0.210.0080.00016.88
8.0.200.0030.00316.96
8.0.190.0000.00716.98
8.0.180.0040.00416.80
8.0.170.0030.00516.91
8.0.160.0030.00316.95
8.0.150.0040.00416.71
8.0.140.0040.00716.82
8.0.130.0030.00313.29
8.0.120.0030.00516.83
8.0.110.0040.00416.91
8.0.100.0070.00016.80
8.0.90.0000.00816.96
8.0.80.0070.00716.85
8.0.70.0040.00416.79
8.0.60.0000.00716.83
8.0.50.0040.00416.88
8.0.30.0160.00417.27
8.0.20.0060.01217.40
8.0.10.0000.00717.05
8.0.00.0100.00916.74
7.4.330.0020.00216.71
7.4.320.0060.00016.60
7.4.300.0040.00416.49
7.4.290.0000.00716.64
7.4.280.0050.00316.34
7.4.270.0030.00316.45
7.4.260.0070.00016.45
7.4.250.0000.00716.45
7.4.240.0070.00016.52
7.4.230.0030.00316.70
7.4.220.0060.01116.68
7.4.210.0000.01416.51
7.4.200.0030.00316.38
7.4.160.0090.00916.54
7.4.150.0060.01217.40
7.4.140.0090.01217.86
7.4.130.0070.01216.56
7.4.120.0070.00916.51
7.4.110.0130.00316.54
7.4.100.0140.00316.31
7.4.90.0090.00916.56
7.4.80.0180.00019.39
7.4.70.0070.01016.52
7.4.60.0060.01016.56
7.4.50.0100.00616.37
7.4.40.0150.00616.38
7.4.30.0030.01416.39
7.4.00.0080.01014.97
7.3.330.0000.00613.34
7.3.320.0050.00013.35
7.3.310.0080.00016.36
7.3.300.0030.00316.20
7.3.290.0070.01016.32
7.3.280.0070.00816.34
7.3.270.0160.00217.40
7.3.260.0150.00616.64
7.3.250.0080.01016.45
7.3.240.0090.01116.33
7.3.230.0110.00616.46
7.3.210.0060.01616.25
7.3.200.0100.01019.39
7.3.190.0040.01116.60
7.3.180.0100.00616.40
7.3.170.0130.00316.67
7.3.160.0090.00616.60
7.3.120.0040.01414.91
7.3.110.0060.01315.02
7.3.100.0060.00314.53
7.3.90.0080.00614.77
7.3.80.0030.01014.61
7.3.70.0000.01114.58
7.3.60.0000.01214.60
7.3.50.0060.00314.71
7.3.40.0100.00315.01
7.3.30.0030.00614.52
7.3.20.0060.01016.68
7.3.10.0000.01416.69
7.3.00.0060.00916.59
7.2.330.0120.00916.80
7.2.320.0060.01216.87
7.2.310.0200.00316.78
7.2.300.0110.00616.66
7.2.290.0130.00316.58
7.2.250.0140.00315.06
7.2.240.0040.01415.04
7.2.230.0090.00914.61
7.2.220.0070.01414.99
7.2.210.0030.01015.17
7.2.200.0060.00315.20
7.2.190.0040.01114.83
7.2.180.0060.00315.11
7.2.170.0080.00415.04
7.2.60.0090.00316.95
7.2.00.0030.01219.32
7.1.330.0030.01315.70
7.1.320.0060.00615.95
7.1.310.0030.01015.88
7.1.300.0040.01116.02
7.1.290.0030.00915.90
7.1.280.0060.00615.80
7.1.270.0000.01315.59
7.1.260.0040.01115.80
7.1.200.0040.00815.77
7.1.100.0040.01118.30
7.1.70.0000.00817.22
7.1.60.0100.01619.40
7.1.50.0040.01817.04
7.1.00.0070.07322.45
7.0.200.0220.00314.98
7.0.60.0170.06721.71
7.0.50.0030.08017.82
7.0.40.0200.05020.05
7.0.30.0370.06720.08
7.0.20.0170.05720.13
7.0.10.0070.04320.33
7.0.00.0000.08320.07
5.6.280.0070.04021.13
5.6.210.0030.04320.76
5.6.200.0030.08018.19
5.6.190.0130.08320.69
5.6.180.0270.07020.48
5.6.170.0170.06720.48
5.6.160.0030.04320.39
5.6.150.0100.06018.28
5.6.140.0100.08018.16
5.6.130.0070.08018.26
5.6.120.0000.04720.99
5.6.110.0000.06721.01
5.6.100.0130.06320.98
5.6.90.0030.04321.01
5.6.80.0130.07320.54
5.5.350.0100.07020.41
5.5.340.0070.03717.96
5.5.330.0030.04720.26
5.5.320.0600.06020.38
5.5.310.0230.07720.36
5.5.300.0070.04717.99
5.5.290.0000.05718.05
5.5.280.0070.04720.88
5.5.270.0070.06320.65
5.5.260.0030.08320.74
5.5.250.0270.07320.71
5.5.240.0170.07720.16

preferences:
26.43 ms | 400 KiB | 5 Q