3v4l.org

run code in 300+ PHP versions simultaneously
<?php function numToOrdinalWord($num) { $first_word = array('eth', 'First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth', 'Seventh', 'Eighth', 'Ninth', 'Tenth', 'Eleventh', 'Twelfth', 'Thirteenth', 'Fourteenth', 'Fifteenth', 'Sixteenth', 'Seventeenth', 'Eighteenth', 'Nineteenth', 'Twentieth'); $second_word = array('', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'); if ($num <= 20) return ($num == 0) ? 'Zeroth' : $first_word[$num]; $first_num = substr($num, -1, 1); $second_num = substr($num, -2, 1); return $string = str_replace( 'y-eth', 'ieth', $second_word[$second_num] . '-' . $first_word[$first_num] ); } for($i = 0; $i < 100; $i++)echo numToOrdinalWord($i) . PHP_EOL;

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.0160.00018.30
8.3.50.0110.00921.20
8.3.40.0120.00319.02
8.3.30.0080.00519.21
8.3.20.0080.00020.20
8.3.10.0050.00323.48
8.3.00.0060.00319.35
8.2.180.0070.00725.92
8.2.170.0120.00918.96
8.2.160.0120.00322.96
8.2.150.0070.00025.66
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0070.00420.45
8.2.110.0060.00321.02
8.2.100.0110.00017.91
8.2.90.0000.00819.37
8.2.80.0080.00017.97
8.2.70.0000.00818.16
8.2.60.0040.00717.93
8.2.50.0000.00818.07
8.2.40.0050.00319.92
8.2.30.0000.00818.20
8.2.20.0080.00017.69
8.2.10.0050.00318.03
8.2.00.0080.00017.62
8.1.280.0040.01125.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0110.01122.55
8.1.230.0080.00420.96
8.1.220.0000.00817.74
8.1.210.0050.00319.01
8.1.200.0040.00417.25
8.1.190.0050.00317.23
8.1.180.0000.00718.10
8.1.170.0000.00818.65
8.1.160.0000.00821.91
8.1.150.0040.00418.95
8.1.140.0040.00417.46
8.1.130.0040.00417.83
8.1.120.0040.00417.44
8.1.110.0040.00417.53
8.1.100.0030.00517.48
8.1.90.0040.00417.50
8.1.80.0040.00417.50
8.1.70.0000.00717.41
8.1.60.0030.00617.66
8.1.50.0040.00417.58
8.1.40.0080.00017.57
8.1.30.0030.00517.57
8.1.20.0040.00417.65
8.1.10.0000.00717.62
8.1.00.0000.00817.41
8.0.300.0060.00319.93
8.0.290.0100.00016.58
8.0.280.0000.00718.38
8.0.270.0000.00717.27
8.0.260.0030.00317.32
8.0.250.0030.00317.02
8.0.240.0040.00416.99
8.0.230.0000.00716.98
8.0.220.0040.00416.92
8.0.210.0000.00716.97
8.0.200.0000.00616.91
8.0.190.0070.00317.04
8.0.180.0060.00316.95
8.0.170.0060.00316.90
8.0.160.0030.00317.00
8.0.150.0000.00716.78
8.0.140.0000.00716.86
8.0.130.0000.00513.33
8.0.120.0030.00516.80
8.0.110.0000.00916.81
8.0.100.0050.00216.73
8.0.90.0040.00416.76
8.0.80.0090.00616.89
8.0.70.0040.00416.78
8.0.60.0000.00816.77
8.0.50.0050.00216.95
8.0.30.0090.01216.93
8.0.20.0110.00917.40
8.0.10.0000.00717.05
8.0.00.0090.01317.01
7.4.330.0030.00315.02
7.4.320.0000.00616.49
7.4.300.0000.00616.41
7.4.290.0070.00016.60
7.4.280.0060.00616.53
7.4.270.0000.00716.70
7.4.260.0040.00416.48
7.4.250.0000.00816.47
7.4.240.0040.00316.49
7.4.230.0030.00316.55
7.4.220.0090.00916.70
7.4.210.0040.01116.66
7.4.200.0030.00316.53
7.4.160.0080.00816.41
7.4.150.0030.01617.40
7.4.140.0100.01317.86
7.4.130.0160.00516.51
7.4.120.0060.01116.42
7.4.110.0110.00716.49
7.4.100.0090.01316.51
7.4.90.0120.00616.38
7.4.80.0100.00819.39
7.4.70.0070.01516.58
7.4.60.0030.01416.48
7.4.50.0000.00516.64
7.4.40.0060.01216.40
7.4.30.0030.01316.72
7.4.00.0060.01015.02
7.3.330.0000.00513.27
7.3.320.0050.00013.31
7.3.310.0040.00416.17
7.3.300.0000.00716.16
7.3.290.0080.00816.33
7.3.280.0080.01016.34
7.3.270.0100.01017.40
7.3.260.0130.00616.45
7.3.250.0120.00616.41
7.3.240.0150.00416.42
7.3.230.0080.00816.58
7.3.210.0150.00316.45
7.3.200.0080.01719.39
7.3.190.0130.00316.52
7.3.180.0110.00616.33
7.3.170.0100.00716.53
7.3.160.0100.01316.57
7.2.330.0160.01616.87
7.2.320.0000.01716.57
7.2.310.0030.01516.77
7.2.300.0140.00316.52
7.2.290.0090.01316.88
7.2.60.0060.01016.73
7.2.00.0030.00919.37
7.1.200.0080.00415.67
7.1.100.0070.00718.22
7.1.70.0030.00617.18
7.1.60.0090.01619.11
7.1.50.0000.01516.92
7.1.00.0100.07022.47
7.0.200.0030.00616.52
7.0.140.0030.07321.95
7.0.60.0070.06319.96
7.0.50.0070.03717.87
7.0.40.0070.05020.20
7.0.30.0370.06320.17
7.0.20.0330.07020.11
7.0.10.0170.06720.30
7.0.00.0100.08020.25
5.6.280.0070.07320.83
5.6.210.0130.07720.70
5.6.200.0030.06018.29
5.6.190.0130.07720.61
5.6.180.0430.07020.48
5.6.170.0400.06320.50
5.6.160.0100.06320.71
5.6.150.0100.08018.19
5.6.140.0030.04018.15
5.6.130.0070.07718.18
5.6.120.0070.08320.90
5.6.110.0030.04720.98
5.6.100.0070.06021.21
5.6.90.0100.06321.05
5.6.80.0070.07020.35
5.5.350.0070.06020.34
5.5.340.0070.08017.95
5.5.330.0100.04320.21
5.5.320.0300.05720.52
5.5.310.0230.07020.32
5.5.300.0030.08317.97
5.5.290.0030.08317.93
5.5.280.0130.04720.78
5.5.270.0100.06320.88
5.5.260.0070.09320.80
5.5.250.0130.07720.71
5.5.240.0300.06720.16
5.4.450.0930.04719.39
5.4.440.0630.05319.55
5.4.430.0630.06719.46
5.4.420.0670.00019.39
5.4.410.0670.00019.44
5.4.400.0630.00019.27
5.4.390.0630.00019.21
5.4.380.0670.00019.26
5.4.370.0800.00019.07
5.4.360.0730.00019.09
5.4.350.0670.00019.03
5.4.340.0070.03412.03
5.4.320.0070.03612.52
5.4.310.0040.04512.51
5.4.300.0120.04112.52
5.4.290.0140.03612.52
5.4.280.0060.04812.41
5.4.270.0070.04912.41
5.4.260.0040.04912.41
5.4.250.0100.04212.41
5.4.240.0130.03412.41
5.4.230.0100.04412.40
5.4.220.0080.03612.41
5.4.210.0070.03712.41
5.4.200.0070.04412.40
5.4.190.0080.03512.40
5.4.180.0070.04212.40
5.4.170.0110.03412.41
5.4.160.0040.04712.40
5.4.150.0060.04212.40
5.4.140.0040.04112.08
5.4.130.0050.04112.07
5.4.120.0060.05012.03
5.4.110.0060.04212.02
5.4.100.0090.03412.02
5.4.90.0050.04012.02
5.4.80.0090.03912.03
5.4.70.0060.03612.02
5.4.60.0050.03712.02
5.4.50.0050.03912.02
5.4.40.0050.03712.01
5.4.30.0070.03512.00
5.4.20.0060.03912.00
5.4.10.0070.03712.00
5.4.00.0060.04111.49
5.3.290.0060.04212.80
5.3.280.0110.03612.71
5.3.270.0100.04012.72
5.3.260.0120.05312.72
5.3.250.0070.04312.72
5.3.240.0080.04412.72
5.3.230.0070.04812.71
5.3.220.0040.04212.68
5.3.210.0050.04512.68
5.3.200.0070.04112.68
5.3.190.0090.04012.68
5.3.180.0080.03612.67
5.3.170.0080.03612.67
5.3.160.0060.04212.67
5.3.150.0070.04412.68
5.3.140.0060.04112.66
5.3.130.0110.03612.66
5.3.120.0060.04112.66
5.3.110.0060.05212.66
5.3.100.0090.03812.13
5.3.90.0080.03712.11
5.3.80.0090.03412.11
5.3.70.0040.05012.10
5.3.60.0100.03812.09
5.3.50.0070.03912.04
5.3.40.0110.03512.04
5.3.30.0070.03511.99
5.3.20.0080.04411.77
5.3.10.0090.04611.74
5.3.00.0050.05211.73
5.2.170.0090.0399.23
5.2.160.0070.0359.23
5.2.150.0050.0329.23
5.2.140.0030.0389.23
5.2.130.0100.0279.19
5.2.120.0100.0299.18
5.2.110.0090.0299.20
5.2.100.0070.0279.19
5.2.90.0070.0359.18
5.2.80.0050.0319.18
5.2.70.0020.0389.19
5.2.60.0060.0379.14
5.2.50.0070.0289.11
5.2.40.0070.0309.09
5.2.30.0060.0359.06
5.2.20.0050.0339.05
5.2.10.0060.0288.96
5.2.00.0050.0378.82
5.1.60.0070.0348.10
5.1.50.0060.0298.10
5.1.40.0050.0298.08
5.1.30.0050.0298.43
5.1.20.0040.0278.45
5.1.10.0020.0298.18
5.1.00.0030.0298.18
5.0.50.0030.0266.66
5.0.40.0050.0196.52
5.0.30.0040.0326.32
5.0.20.0040.0206.30
5.0.10.0050.0206.27
5.0.00.0030.0326.27
4.4.90.0020.0174.78
4.4.80.0050.0144.76
4.4.70.0020.0174.75
4.4.60.0020.0174.76
4.4.50.0020.0174.77
4.4.40.0030.0264.71
4.4.30.0050.0144.76
4.4.20.0020.0184.85
4.4.10.0020.0174.85
4.4.00.0030.0264.76
4.3.110.0040.0164.67
4.3.100.0020.0174.66
4.3.90.0050.0144.63
4.3.80.0030.0264.58
4.3.70.0030.0164.63
4.3.60.0050.0144.63
4.3.50.0070.0134.63
4.3.40.0020.0274.54
4.3.30.0020.0173.32
4.3.20.0010.0183.30
4.3.10.0040.0153.25
4.3.00.0130.0237.27

preferences:
46.15 ms | 401 KiB | 5 Q