3v4l.org

run code in 300+ PHP versions simultaneously
<?php function numberToRoman($decimalNumber) { static $romanSymbolsMap = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1); $result = ''; foreach ($romanSymbolsMap as $roman => $decimal) { if ($decimalNumber >= $decimal) { $result .= str_repeat($roman, $decimalNumber / $decimal); $decimalNumber %= $decimal; } } return $result; } for ($i=1; $i < 5000;$i++){ numberToRoman($i); }

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.0130.01316.63
8.3.50.0100.01421.92
8.3.40.0180.00918.71
8.3.30.0210.00819.22
8.3.20.0110.00620.16
8.3.10.0100.00320.70
8.3.00.0210.00019.51
8.2.180.0250.01116.50
8.2.170.0140.01422.96
8.2.160.0090.01320.20
8.2.150.0140.00024.18
8.2.140.0050.01024.66
8.2.130.0100.00526.16
8.2.120.0050.00521.10
8.2.110.0160.00020.38
8.2.100.0090.01318.16
8.2.90.0070.00319.35
8.2.80.0090.00017.97
8.2.70.0050.00517.63
8.2.60.0000.01217.93
8.2.50.0000.01018.07
8.2.40.0040.00418.28
8.2.30.0080.00419.58
8.2.20.0090.00317.85
8.2.10.0000.01218.17
8.2.00.0030.00717.74
8.1.280.0200.01225.92
8.1.270.0100.01023.71
8.1.260.0080.00426.35
8.1.250.0110.01128.09
8.1.240.0160.00023.98
8.1.230.0000.01519.21
8.1.220.0070.00217.74
8.1.210.0060.00618.77
8.1.200.0000.01617.35
8.1.190.0050.00517.11
8.1.180.0030.00718.10
8.1.170.0000.00918.72
8.1.160.0050.00522.00
8.1.150.0080.00418.90
8.1.140.0030.00717.57
8.1.130.0060.00317.78
8.1.120.0000.01117.55
8.1.110.0000.01017.53
8.1.100.0050.00517.44
8.1.90.0050.00517.55
8.1.80.0050.00917.52
8.1.70.0100.00017.46
8.1.60.0040.00917.68
8.1.50.0050.00517.52
8.1.40.0060.00617.47
8.1.30.0000.01017.71
8.1.20.0100.00017.63
8.1.10.0000.01317.57
8.1.00.0100.00017.55
8.0.300.0040.00818.77
8.0.290.0030.00716.75
8.0.280.0000.00918.38
8.0.270.0060.00317.27
8.0.260.0030.00617.26
8.0.250.0000.00916.97
8.0.240.0060.00317.00
8.0.230.0030.00616.88
8.0.220.0000.00916.84
8.0.210.0030.00716.75
8.0.200.0000.00917.02
8.0.190.0030.00916.97
8.0.180.0060.00616.93
8.0.170.0000.01216.91
8.0.160.0040.00716.86
8.0.150.0000.01016.85
8.0.140.0000.01116.81
8.0.130.0030.00613.38
8.0.120.0000.01116.80
8.0.110.0000.01216.96
8.0.100.0030.00716.85
8.0.90.0000.01116.97
8.0.80.0130.01316.80
8.0.70.0070.00416.80
8.0.60.0070.00316.79
8.0.50.0050.00516.91
8.0.30.0160.01216.91
8.0.20.0130.01017.40
8.0.10.0000.01016.86
8.0.00.0130.01016.93
7.4.330.0000.00815.08
7.4.320.0060.00316.63
7.4.300.0030.00616.64
7.4.290.0060.00316.54
7.4.280.0080.00316.52
7.4.270.0080.00316.62
7.4.260.0000.01016.50
7.4.250.0030.00816.37
7.4.240.0050.00616.47
7.4.230.0040.00716.51
7.4.220.0180.01516.61
7.4.210.0030.01516.65
7.4.200.0030.00716.61
7.4.160.0090.00916.48
7.4.150.0130.01017.40
7.4.140.0090.01217.86
7.4.130.0080.01416.54
7.4.120.0050.01616.65
7.4.110.0000.02116.50
7.4.100.0060.01616.43
7.4.90.0140.00716.57
7.4.80.0160.01619.39
7.4.70.0110.01116.57
7.4.60.0120.01216.48
7.4.50.0000.01316.61
7.4.40.0120.00916.53
7.4.30.0140.00716.52
7.4.00.0020.02014.96
7.3.330.0030.00713.37
7.3.320.0000.00813.32
7.3.310.0070.00316.41
7.3.300.0030.00716.37
7.3.290.0090.01216.36
7.3.280.0120.01716.35
7.3.270.0070.01417.40
7.3.260.0120.01516.45
7.3.250.0090.02116.48
7.3.240.0130.01016.59
7.3.230.0100.01316.41
7.3.210.0070.01416.30
7.3.200.0130.01719.39
7.3.190.0070.02116.30
7.3.180.0100.01016.66
7.3.170.0060.01516.31
7.3.160.0100.01016.67
7.3.120.0090.01614.97
7.3.110.0060.01714.71
7.3.100.0020.01714.88
7.3.90.0040.01414.85
7.3.80.0080.01315.01
7.3.70.0120.00814.92
7.3.60.0060.01114.85
7.3.50.0030.01514.90
7.3.40.0050.01214.90
7.3.30.0050.01214.92
7.3.20.0020.02016.67
7.3.10.0100.01016.53
7.3.00.0080.00816.79
7.2.330.0090.01216.73
7.2.320.0160.00716.55
7.2.310.0090.01316.70
7.2.300.0060.01616.72
7.2.290.0070.01516.75
7.2.250.0080.01815.12
7.2.240.0030.02415.00
7.2.230.0080.01514.97
7.2.220.0050.01614.95
7.2.210.0070.01214.99
7.2.200.0030.01615.02
7.2.190.0070.01214.98
7.2.180.0040.01315.03
7.2.170.0070.01414.91
7.2.60.0040.01516.97
7.2.00.0070.01718.96
7.1.330.0050.01515.89
7.1.320.0030.02015.96
7.1.310.0030.01715.77
7.1.300.0030.02015.88
7.1.290.0070.01515.66
7.1.280.0070.01615.92
7.1.270.0060.01815.64
7.1.260.0030.01815.85
7.1.200.0000.01315.74
7.1.100.0060.01518.11
7.1.70.0000.01617.19
7.1.60.0160.01919.61
7.1.50.0210.01834.57
7.1.00.0000.08722.44
7.0.200.0030.01316.54
7.0.140.0130.07321.92
7.0.60.0000.07320.04
7.0.50.0030.07717.95
7.0.40.0030.09720.18
7.0.30.0300.08720.14
7.0.20.0170.05020.09
7.0.10.0030.06320.21
7.0.00.0070.06320.05
5.6.280.0130.07720.93
5.6.210.0070.05020.46
5.6.200.0130.09318.16
5.6.190.0130.09320.53
5.6.180.0500.08720.33
5.6.170.0170.07320.40
5.6.160.0070.10320.50
5.6.150.0100.09718.27
5.6.140.0000.10018.17
5.6.130.0100.09018.23
5.6.120.0130.09020.88
5.6.110.0070.08721.00
5.6.100.0070.04721.04
5.6.90.0170.03720.98
5.6.80.0030.10020.36
5.5.350.0130.06320.43
5.5.340.0070.09718.02
5.5.330.0100.06020.40
5.5.320.0270.07020.27
5.5.310.0370.04720.19
5.5.300.0100.05318.05
5.5.290.0000.05317.94
5.5.280.0030.05320.85
5.5.270.0170.08720.86
5.5.260.0100.04720.68
5.5.250.0030.08720.61
5.5.240.0200.07720.28
5.4.450.0300.04319.48
5.4.440.0700.05319.49
5.4.430.0100.09319.59
5.4.420.1270.07319.50
5.4.410.0770.07319.36
5.4.400.0570.06319.16
5.4.390.0670.07719.30
5.4.380.0330.07318.48
5.4.370.0370.09718.71
5.4.360.0200.07318.72
5.4.350.0470.09018.79
5.4.340.0300.06718.74
5.4.320.0100.05112.50
5.4.310.0060.04912.50
5.4.300.0100.04712.51
5.4.290.0060.05112.50
5.4.280.0070.05512.40
5.4.270.0070.05112.40
5.4.260.0060.05112.40
5.4.250.0080.05112.40
5.4.240.0080.04512.39
5.4.230.0050.04912.39
5.4.220.0120.04812.39
5.4.210.0070.05112.39
5.4.200.0060.05112.39
5.4.190.0100.05012.39
5.4.180.0080.04912.39
5.4.170.0050.05312.40
5.4.160.0050.04812.39
5.4.150.0070.04512.39
5.4.140.0080.04612.07
5.4.130.0090.04512.06
5.4.120.0060.05012.02
5.4.110.0050.04912.01
5.4.100.0030.05112.02
5.4.90.0060.04812.01
5.4.80.0100.04512.01
5.4.70.0090.04912.00
5.4.60.0090.05012.01
5.4.50.0080.04712.01
5.4.40.0100.05212.00
5.4.30.0080.04812.00
5.4.20.0100.04511.99
5.4.10.0060.04811.99
5.4.00.0030.05011.48
5.3.290.0040.05312.80
5.3.280.0060.05212.71
5.3.270.0100.05712.73
5.3.260.0070.04912.72
5.3.250.0080.06112.72
5.3.240.0070.05112.72
5.3.230.0120.05312.71
5.3.220.0080.05312.68
5.3.210.0070.05812.68
5.3.200.0080.05012.68
5.3.190.0070.05812.68
5.3.180.0070.04812.67
5.3.170.0060.05212.67
5.3.160.0030.05812.68
5.3.150.0050.05212.67
5.3.140.0030.05212.66
5.3.130.0080.05412.65
5.3.120.0080.06112.66
5.3.110.0060.05212.66
5.3.100.0090.04712.11
5.3.90.0090.04812.10
5.3.80.0030.05012.09
5.3.70.0050.04912.09
5.3.60.0060.05112.07
5.3.50.0040.04912.03
5.3.40.0070.04812.02
5.3.30.0040.04811.98
5.3.20.0070.04611.76
5.3.10.0050.04711.73
5.3.00.0030.05111.71
5.2.170.0050.0509.22
5.2.160.0050.0469.22
5.2.150.0060.0499.22
5.2.140.0060.0439.22
5.2.130.0050.0449.18
5.2.120.0040.0469.18
5.2.110.0090.0519.18
5.2.100.0070.0429.18
5.2.90.0080.0449.18
5.2.80.0040.0479.17
5.2.70.0040.0479.17
5.2.60.0050.0479.13
5.2.50.0070.0479.09
5.2.40.0050.0459.07
5.2.30.0070.0489.04
5.2.20.0100.0429.04
5.2.10.0090.0448.94
5.2.00.0080.0478.80
5.1.60.0050.0408.09
5.1.50.0030.0468.09
5.1.40.0060.0418.07
5.1.30.0060.0418.42
5.1.20.0040.0498.44
5.1.10.0080.0388.16
5.1.00.0100.0618.17
5.0.50.0020.0756.65
5.0.40.0050.0636.50
5.0.30.0050.0806.32
5.0.20.0030.0736.29
5.0.10.0070.0636.27
5.0.00.0040.0786.26
4.4.90.0060.0624.78
4.4.80.0040.0594.75
4.4.70.0050.0744.75
4.4.60.0030.0644.75
4.4.50.0030.0694.77
4.4.40.0030.0824.71
4.4.30.0030.0634.76
4.4.20.0040.0624.84
4.4.10.0050.0634.85
4.4.00.0010.0744.76
4.3.110.0040.0694.67
4.3.100.0070.0674.67
4.3.90.0040.0634.64
4.3.80.0030.0824.58
4.3.70.0030.0644.63
4.3.60.0060.0734.63
4.3.50.0040.0604.63
4.3.40.0010.0804.54
4.3.30.0020.0723.31
4.3.20.0030.0663.29
4.3.10.0020.0643.25
4.3.00.0000.06014.28

preferences:
46.37 ms | 401 KiB | 5 Q