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)); echo $first_letter."<br>"; print_r($vowels); $new_string = ""; if( in_array($vowels,$first_letter) ) { $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.0140.00716.75
8.3.50.0120.00721.89
8.3.40.0070.01018.65
8.3.30.0000.01518.94
8.3.20.0040.00420.30
8.3.10.0000.00823.65
8.3.00.0080.00020.93
8.2.180.0180.00416.73
8.2.170.0090.00922.96
8.2.160.0140.00020.35
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00319.13
8.2.110.0040.00422.25
8.2.100.0060.00617.97
8.2.90.0040.00419.25
8.2.80.0000.00817.97
8.2.70.0060.00517.50
8.2.60.0040.00417.90
8.2.50.0070.00518.07
8.2.40.0040.00419.88
8.2.30.0070.00018.31
8.2.20.0000.00817.63
8.2.10.0000.00718.19
8.2.00.0040.00417.75
8.1.280.0110.00425.92
8.1.270.0120.00623.85
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.76
8.1.230.0050.00518.90
8.1.220.0070.00017.79
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0000.00718.10
8.1.170.0040.00418.65
8.1.160.0050.00221.84
8.1.150.0000.00718.53
8.1.140.0000.00717.39
8.1.130.0000.00719.66
8.1.120.0040.00317.33
8.1.110.0000.00717.38
8.1.100.0000.00717.43
8.1.90.0000.00717.31
8.1.80.0000.00717.40
8.1.70.0030.00317.39
8.1.60.0080.00017.59
8.1.50.0060.00317.60
8.1.40.0090.00317.55
8.1.30.0030.00517.61
8.1.20.0000.00717.70
8.1.10.0040.00417.54
8.1.00.0040.00417.56
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0050.00218.38
8.0.270.0030.00317.27
8.0.260.0030.00317.26
8.0.250.0000.00716.93
8.0.240.0030.00516.98
8.0.230.0030.00317.02
8.0.220.0030.00316.86
8.0.210.0000.00716.98
8.0.200.0000.00717.04
8.0.190.0030.00517.06
8.0.180.0040.00416.87
8.0.170.0000.00816.98
8.0.160.0000.00716.82
8.0.150.0070.00016.97
8.0.140.0050.00316.87
8.0.130.0000.00513.37
8.0.120.0050.00316.82
8.0.110.0040.00416.95
8.0.100.0050.00316.96
8.0.90.0000.00716.99
8.0.80.0100.01016.84
8.0.70.0000.00716.84
8.0.60.0040.00417.00
8.0.50.0000.00717.00
8.0.30.0140.00817.31
8.0.20.0100.00817.40
8.0.10.0040.00416.90
8.0.00.0100.00716.78
7.4.330.0050.00015.06
7.4.320.0000.00716.45
7.4.300.0060.00016.51
7.4.290.0000.00716.57
7.4.280.0000.00816.55
7.4.270.0030.00316.54
7.4.260.0000.00716.50
7.4.250.0000.00716.48
7.4.240.0020.00516.58
7.4.230.0000.00716.67
7.4.220.0030.01616.50
7.4.210.0110.00716.52
7.4.200.0070.00016.58
7.4.160.0160.00616.45
7.4.150.0180.00317.40
7.4.140.0110.00917.86
7.4.130.0090.00816.48
7.4.120.0090.01216.65
7.4.110.0070.01716.54
7.4.100.0070.01116.64
7.4.90.0130.01116.43
7.4.80.0070.01019.39
7.4.70.0060.01216.41
7.4.60.0060.01016.61
7.4.50.0030.00316.30
7.4.40.0190.00316.75
7.4.30.0120.00416.74
7.4.00.0000.01215.10
7.3.330.0000.00613.29
7.3.320.0000.00513.36
7.3.310.0030.00316.25
7.3.300.0040.00416.27
7.3.290.0070.01316.33
7.3.280.0080.00916.38
7.3.270.0130.00317.40
7.3.260.0080.01216.48
7.3.250.0100.01116.46
7.3.240.0090.00916.44
7.3.230.0080.00816.50
7.3.210.0110.00616.29
7.3.200.0150.00719.39
7.3.190.0090.01216.58
7.3.180.0110.00416.51
7.3.170.0040.01216.42
7.3.160.0160.00016.50
7.3.120.0030.00714.68
7.2.330.0060.01016.47
7.2.320.0110.00716.78
7.2.310.0130.00616.78
7.2.300.0060.01016.38
7.2.290.0070.01016.71
7.2.00.0030.00919.57
7.1.100.0110.00718.16
7.1.70.0030.01017.09
7.1.60.0060.01919.70
7.1.50.0110.00716.95
7.1.00.0070.07322.44
7.0.200.0000.00816.85
7.0.140.0030.07021.99
7.0.60.0100.07319.86
7.0.50.0030.07017.97
7.0.40.0070.07020.30
7.0.30.0300.07720.06
7.0.20.0300.09320.30
7.0.10.0070.08720.09
7.0.00.0130.05320.22
5.6.280.0070.06721.07
5.6.210.0130.06320.55
5.6.200.0170.07718.23
5.6.190.0030.05320.47
5.6.180.0230.06720.55
5.6.170.0230.04320.50
5.6.160.0070.07020.50
5.6.150.0030.04318.20
5.6.140.0100.08018.15
5.6.130.0070.04018.15
5.6.120.0030.05720.99
5.6.110.0070.04021.02
5.6.100.0030.09020.98
5.6.90.0070.05321.18
5.6.80.0030.04020.40
5.6.70.4630.03720.38
5.5.350.0100.04720.30
5.5.340.0100.06718.02
5.5.330.0100.08020.29
5.5.320.0170.05020.24
5.5.310.0400.06720.34
5.5.300.0100.04317.97
5.5.290.0100.06317.99
5.5.280.0130.07720.77
5.5.270.0070.06320.89
5.5.260.0070.08320.98
5.5.250.0130.08020.71
5.5.240.1200.03020.26
5.4.450.0430.04734.72
5.4.440.0270.04032.89
5.4.430.0170.04332.19
5.4.420.0470.04732.19
5.4.410.0270.03732.19
5.4.400.0100.04332.19
5.4.390.0330.03732.11
5.4.380.0770.05318.50
5.4.370.0600.05718.62
5.4.360.0800.05718.74
5.4.350.1000.04718.74
5.4.340.0500.05318.73
5.4.320.0020.03912.50
5.4.310.0050.03812.50
5.4.300.0050.03912.51
5.4.290.0080.03812.50
5.4.280.0070.04412.40
5.4.270.0140.04712.40
5.4.260.0080.05112.40
5.4.250.0070.05012.40
5.4.240.0080.04412.40
5.4.230.0100.04912.39
5.4.220.0090.05012.39
5.4.210.0130.04412.39
5.4.200.0080.04712.39
5.4.190.0070.04412.39
5.4.180.0090.03712.38
5.4.170.0070.04112.39
5.4.160.0090.03912.39
5.4.150.0080.04012.39
5.4.140.0050.04112.07
5.4.130.0090.03912.06
5.4.120.0100.04612.02
5.4.110.0110.04512.02
5.4.100.0100.04612.02
5.4.90.0040.05412.01
5.4.80.0100.04812.01
5.4.70.0070.04812.01
5.4.60.0110.04712.01
5.4.50.0110.04812.01
5.4.40.0060.05011.99
5.4.30.0070.05011.99
5.4.20.0080.04912.00
5.4.10.0090.04411.99
5.4.00.0060.05111.48
5.3.290.0110.03612.80
5.3.280.0080.05112.71
5.3.270.0090.05312.72
5.3.260.0060.04112.72
5.3.250.0090.04112.71
5.3.240.0090.04112.72
5.3.230.0050.04212.71
5.3.220.0100.03812.68
5.3.210.0100.03812.68
5.3.200.0060.04212.68
5.3.190.0070.04212.67
5.3.180.0060.04212.68
5.3.170.0090.03912.67
5.3.160.0050.04412.67
5.3.150.0070.05212.67
5.3.140.0040.03912.66
5.3.130.0070.03812.66
5.3.120.0070.03912.66
5.3.110.0090.04112.66
5.3.100.0100.03612.11
5.3.90.0050.04312.10
5.3.80.0050.05012.09
5.3.70.0040.05012.09
5.3.60.0100.04412.07
5.3.50.0090.04312.02
5.3.40.0100.04212.02
5.3.30.0080.05211.98
5.3.20.0080.04211.76
5.3.10.0080.03711.73
5.3.00.0100.03411.72
5.2.170.0040.0339.21
5.2.160.0060.0309.21
5.2.150.0050.0319.22
5.2.140.0070.0329.21
5.2.130.0050.0339.18
5.2.120.0010.0349.18
5.2.110.0050.0309.18
5.2.100.0070.0299.18
5.2.90.0050.0309.17
5.2.80.0060.0309.17
5.2.70.0070.0289.16
5.2.60.0060.0309.13
5.2.50.0020.0369.10
5.2.40.0060.0309.07
5.2.30.0060.0309.05
5.2.20.0040.0339.03
5.2.10.0080.0338.94
5.2.00.0020.0348.80
5.1.60.0030.0268.09
5.1.50.0060.0278.09
5.1.40.0080.0228.06
5.1.30.0030.0308.41
5.1.20.0030.0288.43
5.1.10.0060.0278.16
5.1.00.0070.0328.16
5.0.50.0020.0246.64
5.0.40.0040.0196.50
5.0.30.0040.0326.31
5.0.20.0080.0216.28
5.0.10.0060.0266.26
5.0.00.0050.0336.25
4.4.90.0040.0144.78
4.4.80.0050.0134.76
4.4.70.0020.0164.75
4.4.60.0010.0184.75
4.4.50.0020.0174.77
4.4.40.0020.0274.71
4.4.30.0020.0174.76
4.4.20.0030.0164.85
4.4.10.0040.0144.84
4.4.00.0040.0244.75
4.3.110.0030.0164.67
4.3.100.0020.0164.67
4.3.90.0050.0164.63
4.3.80.0050.0234.58
4.3.70.0060.0124.63
4.3.60.0040.0144.63
4.3.50.0040.0154.62
4.3.40.0040.0234.54
4.3.30.0000.0183.30
4.3.20.0030.0163.27
4.3.10.0010.0173.24
4.3.00.0030.01731.83

preferences:
36.55 ms | 401 KiB | 5 Q