3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { } $obj = new myClass; $obj->color = function( $flower ){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; return $arr[$flower]; }; for ($flower = "rose";;){ if ($flower == "rose"){ echo "{$flower}s are ",($obj->color)($flower),"\n"; } else { break; } }

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.0180.01116.63
8.3.50.0560.00718.30
8.3.40.0630.01019.02
8.3.30.0500.01218.85
8.3.20.0400.00420.22
8.3.10.0350.00423.48
8.3.00.0190.00921.82
8.2.180.0540.01416.50
8.2.170.0480.01422.96
8.2.160.0530.01022.18
8.2.150.0350.01024.18
8.2.140.0380.00724.66
8.2.130.0340.00720.85
8.2.120.0310.00826.35
8.2.110.0360.01120.38
8.2.100.0180.00717.91
8.2.90.0190.00019.17
8.2.80.0110.00717.97
8.2.70.0040.00817.75
8.2.60.0030.00717.93
8.2.50.0100.01018.09
8.2.40.0140.00522.29
8.2.30.0090.00919.59
8.2.20.0130.00717.95
8.2.10.0200.00018.21
8.2.00.0130.00618.12
8.1.280.0600.01325.92
8.1.270.0230.00422.10
8.1.260.0260.01128.09
8.1.250.0360.00328.09
8.1.240.0230.01423.96
8.1.230.0280.01420.92
8.1.220.0170.00717.74
8.1.210.0080.01218.77
8.1.200.0140.00717.36
8.1.190.0160.00317.22
8.1.180.0160.00618.10
8.1.170.0000.01118.56
8.1.160.0100.00020.84
8.1.150.0100.00020.69
8.1.140.0180.00319.59
8.1.130.0170.00717.82
8.1.120.0120.00017.44
8.1.110.0110.00717.45
8.1.100.0110.00817.55
8.1.90.0030.01017.41
8.1.80.0080.00317.57
8.1.70.0100.01017.54
8.1.60.0060.00617.59
8.1.50.0110.00417.58
8.1.40.0100.01017.61
8.1.30.0120.00817.67
8.1.20.0070.00317.57
8.1.10.0080.00417.72
8.1.00.0100.01517.46
8.0.300.0130.00518.77
8.0.290.0070.00416.75
8.0.280.0150.00418.40
8.0.270.0140.00617.24
8.0.260.0130.00517.16
8.0.250.0090.00316.95
8.0.240.0070.01116.94
8.0.230.0070.00417.00
8.0.220.0140.00316.86
8.0.210.0030.00616.92
8.0.200.0100.00716.89
8.0.190.0050.01516.98
8.0.180.0000.01016.94
8.0.170.0100.01316.81
8.0.160.0160.00816.97
8.0.150.0100.00316.75
8.0.140.0040.00716.82
8.0.130.0000.00813.35
8.0.120.0140.00916.70
8.0.110.0170.00316.81
8.0.100.0040.01316.66
8.0.90.0040.01116.79
8.0.80.0130.02616.80
8.0.70.0030.00716.87
8.0.60.0120.00616.78
8.0.50.0150.00516.70
8.0.30.0450.02116.91
8.0.20.0640.02817.40
8.0.10.0100.00017.02
8.0.00.0610.03016.86
7.4.330.0070.01116.84
7.4.320.0140.00716.38
7.4.300.0090.00916.44
7.4.290.0120.00016.24
7.4.280.0030.00916.29
7.4.270.0120.00616.52
7.4.260.0140.00916.50
7.4.250.0060.00616.30
7.4.240.0100.01016.37
7.4.230.0070.01016.48
7.4.220.0320.05716.50
7.4.210.0130.01616.34
7.4.200.0100.00016.59
7.4.160.0500.03616.55
7.4.150.0570.04017.40
7.4.140.0580.03917.86
7.4.130.0530.04716.39
7.4.120.0550.04616.55
7.4.110.0610.02816.46
7.4.100.0880.03116.48
7.4.90.0590.03716.54
7.4.80.0520.04519.39
7.4.70.0340.03816.51
7.4.60.0650.03716.53
7.4.50.0130.01716.49
7.4.40.0720.04416.55
7.4.30.0920.03816.26
7.4.00.0290.00714.71
7.3.330.0150.00513.38
7.3.320.0120.00613.15
7.3.310.0110.00716.30
7.3.300.0040.01316.26
7.3.290.0370.03516.29
7.3.280.0370.03216.24
7.3.270.0920.02217.40
7.3.260.0600.04116.40
7.3.250.0620.02716.36
7.3.240.0680.03416.48
7.3.230.0530.02216.43
7.3.210.0530.03816.50
7.3.200.0480.03019.39
7.3.190.0570.02616.43
7.3.180.0390.04016.46
7.3.170.0400.04316.48
7.3.160.0240.01216.55
7.2.330.0470.03216.75
7.2.320.0520.02916.68
7.2.310.0550.02416.53
7.2.300.0420.04316.43
7.2.290.0510.02216.66
7.2.60.0100.01316.88
7.2.00.0190.00019.22
7.1.200.0130.01015.46
7.1.100.0170.00318.27
7.1.70.0070.00417.23
7.1.60.0260.01319.40
7.1.50.0250.02217.18
7.1.00.0170.07722.26
7.0.200.0170.01016.76
7.0.120.0170.07321.97
7.0.110.0100.08722.13
7.0.100.0130.08021.96
7.0.90.0200.07322.06
7.0.80.0200.06721.97
7.0.70.0200.06322.18
7.0.60.0100.06022.05
7.0.50.0200.07322.00
7.0.40.0030.07022.07
7.0.30.0130.07322.17
7.0.20.0130.07322.03
7.0.10.0170.06322.04
7.0.00.0130.07322.11
5.6.280.0000.03321.16
5.6.260.0000.07321.08
5.6.250.0030.07320.99
5.6.240.0070.07021.10
5.6.230.0070.07321.12
5.6.220.0070.07021.08
5.6.210.0000.07721.02
5.6.200.0030.07321.05
5.6.190.0070.07020.75
5.6.180.0030.07021.06
5.6.170.0000.07321.04
5.6.160.0030.06721.01
5.6.150.0070.07320.94
5.6.140.0130.06720.75
5.6.130.0030.07020.94
5.6.120.0070.07320.92
5.6.110.0070.07020.84
5.6.100.0070.07321.05
5.6.90.0000.07720.87
5.6.80.0030.06320.47
5.6.70.0030.06720.38
5.6.60.0030.07320.41
5.6.50.0000.07020.47
5.6.40.0000.07020.42
5.6.30.0100.06020.27
5.6.20.0070.06020.42
5.6.10.0100.05320.11
5.6.00.0170.05720.23
5.5.380.0070.06717.70
5.5.370.0000.07317.70
5.5.360.0030.07317.71
5.5.350.0000.06717.67
5.5.340.0000.06718.09
5.5.330.0000.06717.93
5.5.320.0030.07018.14
5.5.310.0000.07318.15
5.5.300.0030.07017.91
5.5.290.0030.07318.25
5.5.280.0030.07717.93
5.5.270.0000.07717.83
5.5.260.0000.07718.09
5.5.250.0070.07017.91
5.5.240.0030.07017.32
5.5.230.0000.07017.63
5.5.220.0070.05717.46
5.5.210.0030.07017.47
5.5.200.0030.06317.27
5.5.190.0070.06717.27
5.5.180.0030.07017.45
5.5.160.0030.06717.57
5.5.150.0000.06717.48
5.5.140.0030.07017.44
5.5.130.0000.06717.26
5.5.120.0030.05717.57
5.5.110.0030.07017.57
5.5.100.0070.05717.38
5.5.90.0030.06717.50
5.5.80.0030.06017.32
5.5.70.0070.06717.16
5.5.60.0000.07017.34
5.5.50.0030.06717.38
5.5.40.0000.06017.50
5.5.30.0070.06317.29
5.5.20.0000.07317.07
5.5.10.0030.06317.51
5.5.00.0000.07317.49

preferences:
54.57 ms | 401 KiB | 5 Q