3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_position($string) { $vowels = array("a,e,i,o,u"); $first_letter = strtolower(substr($string,0,1)); $new_string = ""; if( in_array($first_letter,$vowels) ) { $new_string = "an <strong>".ucfirst($string)."</strong>"; } else { $new_string = "a <strong>".ucfirst($string)."</strong>"; } return $new_string; } $output1 = get_position("Advertising"); $output2 = get_position("Marketing"); echo $output1."<br>"; echo $output2."<br>";

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.0110.00718.30
8.3.50.0100.00922.08
8.3.40.0070.00718.59
8.3.30.0110.00819.27
8.3.20.0080.00020.21
8.3.10.0080.00023.53
8.3.00.0040.00419.02
8.2.180.0090.01318.00
8.2.170.0110.00422.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00319.23
8.2.110.0100.00720.98
8.2.100.0110.00017.72
8.2.90.0000.00817.91
8.2.80.0040.00419.66
8.2.70.0000.00918.04
8.2.60.0060.00318.09
8.2.50.0030.00618.10
8.2.40.0030.00619.46
8.2.30.0000.00718.24
8.2.20.0080.00017.75
8.2.10.0000.00718.02
8.2.00.0000.00817.80
8.1.280.0070.00725.92
8.1.270.0000.00823.96
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0040.00422.05
8.1.230.0040.00822.66
8.1.220.0000.00917.74
8.1.210.0040.00420.25
8.1.200.0000.00817.23
8.1.190.0090.00017.36
8.1.180.0050.00318.10
8.1.170.0040.00418.34
8.1.160.0000.00721.88
8.1.150.0050.00518.63
8.1.140.0050.00317.34
8.1.130.0000.00819.61
8.1.120.0030.00317.34
8.1.110.0040.00417.37
8.1.100.0040.00417.40
8.1.90.0030.00517.43
8.1.80.0050.00317.39
8.1.70.0030.00317.41
8.1.60.0080.00017.46
8.1.50.0030.00617.49
8.1.40.0030.00717.48
8.1.30.0040.00417.63
8.1.20.0040.00417.60
8.1.10.0000.00817.42
8.1.00.0040.00417.29
8.0.300.0040.00419.99
8.0.290.0050.00316.75
8.0.280.0000.00718.34
8.0.270.0000.00717.27
8.0.260.0000.00617.23
8.0.250.0030.00316.97
8.0.240.0000.00817.03
8.0.230.0040.00416.97
8.0.220.0070.00016.91
8.0.210.0030.00416.86
8.0.200.0030.00316.98
8.0.190.0070.00016.95
8.0.180.0060.00316.84
8.0.170.0070.00016.83
8.0.160.0030.00316.89
8.0.150.0060.00316.86
8.0.140.0060.00316.86
8.0.130.0030.00313.42
8.0.120.0040.00416.89
8.0.110.0000.00816.70
8.0.100.0000.00716.76
8.0.90.0080.00016.86
8.0.80.0090.00616.83
8.0.70.0040.00416.77
8.0.60.0040.00416.92
8.0.50.0070.00016.94
8.0.30.0080.01017.21
8.0.20.0050.01417.40
8.0.10.0070.00016.76
8.0.00.0080.01116.90
7.4.330.0000.00515.00
7.4.320.0030.00316.54
7.4.300.0000.00616.64
7.4.290.0030.00316.50
7.4.280.0040.00416.44
7.4.270.0030.00316.58
7.4.260.0000.00916.43
7.4.250.0080.00016.36
7.4.240.0030.00316.45
7.4.230.0070.00016.39
7.4.220.0040.01316.54
7.4.210.0070.00716.65
7.4.200.0000.00716.59
7.4.160.0040.01416.57
7.4.150.0120.01217.40
7.4.140.0130.00517.86
7.4.130.0080.01016.67
7.4.120.0060.01316.43
7.4.110.0070.01416.53
7.4.100.0090.00916.63
7.4.90.0080.01216.74
7.4.80.0070.01119.39
7.4.70.0100.00716.39
7.4.60.0060.01116.33
7.4.50.0000.00416.52
7.4.40.0040.01216.62
7.4.30.0090.00616.54
7.4.00.0070.01014.84
7.3.330.0060.00013.11
7.3.320.0060.00013.30
7.3.310.0030.00316.19
7.3.300.0020.00516.16
7.3.290.0090.00916.32
7.3.280.0060.01016.26
7.3.270.0090.00917.40
7.3.260.0120.00616.30
7.3.250.0140.00516.51
7.3.240.0150.00816.26
7.3.230.0120.00616.53
7.3.210.0040.01216.41
7.3.200.0060.00919.39
7.3.190.0110.01116.63
7.3.180.0030.01216.21
7.3.170.0040.01616.46
7.3.160.0060.00916.45
7.3.120.0030.00914.79
7.2.330.0090.01316.68
7.2.320.0100.01116.43
7.2.310.0100.00716.73
7.2.300.0130.00316.60
7.2.290.0070.01016.64
7.1.200.0080.00015.73
7.1.70.0080.00016.83
7.1.60.0100.00319.70
7.1.50.0060.01816.96
7.1.00.0000.08022.45
7.0.200.0030.00616.82
7.0.140.0100.06721.97
7.0.60.0070.07319.83
7.0.50.0070.06017.80
7.0.40.0100.07320.27
7.0.30.0430.07020.33
7.0.20.0200.07320.26
7.0.10.0030.04720.24
7.0.00.0100.07720.09
5.6.280.0030.07020.78
5.6.210.0130.07720.70
5.6.200.0030.05318.16
5.6.190.0070.09020.49
5.6.180.0230.08020.63
5.6.170.0400.07720.52
5.6.160.0100.03320.55
5.6.150.0070.03718.14
5.6.140.0030.04018.18
5.6.130.0100.05018.18
5.6.120.0030.05720.99
5.6.110.0030.07021.01
5.6.100.0130.05021.11
5.6.90.0070.05721.00
5.6.80.0100.07320.48
5.6.70.4630.03320.44
5.5.350.0170.06720.44
5.5.340.0070.07717.95
5.5.330.0070.05320.21
5.5.320.0230.05020.32
5.5.310.0200.04720.34
5.5.300.0070.05318.09
5.5.290.0030.07318.08
5.5.280.0030.06320.85
5.5.270.0130.03320.80
5.5.260.0070.09020.87
5.5.250.0070.08320.78
5.5.240.0100.07320.16
5.4.450.0230.04734.72
5.4.440.0200.04032.20
5.4.430.0670.03732.19
5.4.420.0170.04332.19
5.4.410.0430.03732.19
5.4.400.0400.02732.20
5.4.390.0230.05032.09
5.4.380.0300.05718.75
5.4.370.0300.05318.73
5.4.360.0330.04318.75
5.4.350.0370.04718.72
5.4.340.0270.05318.56
5.4.320.0020.04612.51
5.4.310.0060.04212.50
5.4.300.0070.05712.50
5.4.290.0080.05412.50
5.4.280.0080.05812.40
5.4.270.0080.04612.40
5.4.260.0110.04512.40
5.4.250.0110.04712.40
5.4.240.0090.04812.40
5.4.230.0080.05012.39
5.4.220.0050.05512.39
5.4.210.0070.03712.39
5.4.200.0070.04012.39
5.4.190.0070.04012.38
5.4.180.0040.04312.39
5.4.170.0080.04112.39
5.4.160.0080.03912.39
5.4.150.0110.04412.39
5.4.140.0060.04112.07
5.4.130.0080.03612.06
5.4.120.0130.03512.02
5.4.110.0060.03712.01
5.4.100.0060.03612.01
5.4.90.0090.03512.01
5.4.80.0080.04512.01
5.4.70.0050.05112.01
5.4.60.0120.04312.01
5.4.50.0070.04912.00
5.4.40.0040.04812.00
5.4.30.0120.04312.00
5.4.20.0090.04811.99
5.4.10.0140.03711.99
5.4.00.0050.03711.48
5.3.290.0070.04712.80
5.3.280.0040.04312.71
5.3.270.0050.04512.72
5.3.260.0030.04512.72
5.3.250.0060.03912.72
5.3.240.0060.05012.72
5.3.230.0110.04012.71
5.3.220.0070.05212.68
5.3.210.0100.05212.68
5.3.200.0130.04912.68
5.3.190.0100.04912.68
5.3.180.0150.03812.67
5.3.170.0120.04512.67
5.3.160.0130.04612.67
5.3.150.0090.04212.67
5.3.140.0090.04412.66
5.3.130.0120.03712.65
5.3.120.0110.03512.66
5.3.110.0070.04212.66
5.3.100.0110.04612.12
5.3.90.0120.03612.10
5.3.80.0050.04412.09
5.3.70.0050.03912.09
5.3.60.0090.03612.07
5.3.50.0100.03612.02
5.3.40.0090.03612.02
5.3.30.0060.04111.98
5.3.20.0110.04311.76
5.3.10.0100.03811.73
5.3.00.0070.04011.71
5.2.170.0140.0339.22
5.2.160.0050.0369.21
5.2.150.0080.0349.21
5.2.140.0060.0349.21
5.2.130.0060.0349.17
5.2.120.0030.0319.17
5.2.110.0050.0309.18
5.2.100.0040.0349.18
5.2.90.0110.0359.17
5.2.80.0060.0319.17
5.2.70.0080.0309.17
5.2.60.0040.0419.13
5.2.50.0050.0449.09
5.2.40.0050.0329.07
5.2.30.0050.0309.04
5.2.20.0110.0349.04
5.2.10.0140.0488.94
5.2.00.0030.0308.80
5.1.60.0040.0248.09
5.1.50.0080.0248.08
5.1.40.0060.0338.06
5.1.30.0060.0348.41
5.1.20.0060.0358.43
5.1.10.0030.0358.16
5.1.00.0060.0358.16
5.0.50.0070.0246.63
5.0.40.0060.0206.50
5.0.30.0050.0346.31
5.0.20.0030.0236.27
5.0.10.0030.0216.25
5.0.00.0050.0306.25
4.4.90.0030.0174.78
4.4.80.0040.0154.75
4.4.70.0020.0164.75
4.4.60.0050.0144.75
4.4.50.0010.0174.77
4.4.40.0060.0234.71
4.4.30.0030.0174.76
4.4.20.0020.0164.85
4.4.10.0060.0154.85
4.4.00.0030.0304.76
4.3.110.0040.0184.67
4.3.100.0040.0174.66
4.3.90.0040.0154.63
4.3.80.0040.0264.59
4.3.70.0030.0174.63
4.3.60.0040.0154.63
4.3.50.0030.0174.63
4.3.40.0020.0254.54
4.3.30.0000.0193.31
4.3.20.0040.0153.29
4.3.10.0020.0163.25
4.3.00.0070.01331.70

preferences:
34.69 ms | 401 KiB | 5 Q