3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Ovo je samo jedan od testnih kodova"; $a = array('a','e','i','o','u'); $strlen = strlen( $str ); $siz = sizeof($a); $res = ""; $rest = ""; $t= ""; $sugl = array(); $pozsugl = array(); for( $i = 0; $i <= $strlen; $i++ ) { $char = substr( $str, $i, 1 ); $t = false; // $char contains the current character, so do your processing here for($j=0; $j<$siz;$j++) { if($a[$j] === $char) { $t = true; if($j+1 === $siz) { $res.= $a[0]; break; } else { $res .= $a[$j+1]; break; } } } if(!$t) { $res.=$char; array_push($sugl, $char); array_push($pozsugl, $i); } } echo "\n"."sugl ".printing($sugl)."\n" ; echo "\n"."pozsugl ".printing($pozsugl)."\n"; $sugl = sorty($sugl); echo "\n"."sugl poslije sorty ".printing($sugl)."\n"; echo "\n"."\n"."Rezultat prije ". $res ."\n"; echo "\n"."Rezultat nakon svega:" . changeChar($res,$pozsugl, $sugl); function sorty($c) { $siz = sizeof($c); $tmp = $c[0]; for ($i = 1; $i < $siz; $i++) $c[$i - 1] = $c[$i]; $c[$siz - 1] = $tmp; return $c; } function changeChar($str, $pozsugl, $sugl) { $strlen = strlen( $str ); $siz= sizeof($pozsugl); $rez = ""; for($i = 0; $i <= $strlen; $i++) { $char = substr( $str, $i, 1 ); for($j=0; $j<$siz;$j++) { if($i === $pozsugl[$j]) { $char=$sugl[$j]; break; } } $rez.=$char; } return $rez; } function printing($f) { $siz= sizeof($f); $t=""; for($k=0; $k <$siz; $k++) $t.=$f[$k]; echo $t; } ?>

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.0090.00618.29
8.3.50.0070.01022.96
8.3.40.0140.00018.82
8.3.30.0140.00019.09
8.3.20.0000.00720.24
8.3.10.0130.00320.65
8.3.00.0080.00019.51
8.2.180.0080.00816.50
8.2.170.0130.00622.96
8.2.160.0050.00820.22
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0030.00519.79
8.2.110.0060.00322.29
8.2.100.0120.00017.78
8.2.90.0040.00419.22
8.2.80.0060.00317.97
8.2.70.0030.00617.63
8.2.60.0000.00818.05
8.2.50.0090.00018.07
8.2.40.0030.00818.16
8.2.30.0050.00518.27
8.2.20.0050.00317.75
8.2.10.0000.00718.12
8.2.00.0080.00017.87
8.1.280.0100.00325.92
8.1.270.0050.00320.67
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00722.06
8.1.230.0000.01217.52
8.1.220.0040.00417.76
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0060.00317.55
8.1.180.0040.00418.10
8.1.170.0000.00818.90
8.1.160.0040.00418.91
8.1.150.0000.00718.89
8.1.140.0080.00017.50
8.1.130.0000.00717.78
8.1.120.0000.00717.56
8.1.110.0080.00017.49
8.1.100.0000.00717.52
8.1.90.0070.00017.41
8.1.80.0040.00417.46
8.1.70.0030.00317.46
8.1.60.0030.00517.60
8.1.50.0050.00317.48
8.1.40.0040.00417.57
8.1.30.0040.00417.71
8.1.20.0000.00917.54
8.1.10.0030.00517.61
8.1.00.0030.00617.42
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0070.00018.50
8.0.270.0000.00817.31
8.0.260.0040.00417.30
8.0.250.0000.00716.90
8.0.240.0000.00716.99
8.0.230.0040.00416.92
8.0.220.0030.00316.97
8.0.210.0030.00316.85
8.0.200.0000.00716.87
8.0.190.0000.00816.99
8.0.180.0040.00416.86
8.0.170.0080.00016.85
8.0.160.0070.00017.05
8.0.150.0080.00016.84
8.0.140.0020.00516.91
8.0.130.0040.00413.37
8.0.120.0000.00816.77
8.0.110.0000.00716.96
8.0.100.0040.00417.05
8.0.90.0040.00416.74
8.0.80.0100.00616.91
8.0.70.0000.00716.95
8.0.60.0000.00816.84
8.0.50.0000.00716.97
8.0.30.0150.00617.22
8.0.20.0120.00717.40
8.0.10.0040.00416.94
8.0.00.0080.01016.81
7.4.330.0000.00515.02
7.4.320.0000.00616.57
7.4.300.0040.00416.55
7.4.290.0030.00516.64
7.4.280.0030.00616.41
7.4.270.0040.00416.57
7.4.260.0030.00316.66
7.4.250.0060.00316.58
7.4.240.0060.00116.60
7.4.230.0070.00016.40
7.4.220.0040.01516.66
7.4.210.0100.00616.57
7.4.200.0040.00416.36
7.4.160.0060.01016.48
7.4.150.0260.00017.40
7.4.140.0070.01017.86
7.4.130.0070.01216.63
7.4.120.0100.00716.54
7.4.110.0110.00716.56
7.4.100.0100.00716.53
7.4.90.0070.01016.61
7.4.80.0080.00816.48
7.4.70.0060.01616.54
7.4.60.0070.01016.57
7.4.50.0090.00016.55
7.4.40.0110.00716.48
7.4.30.0070.01016.81
7.4.00.0120.00314.71
7.3.330.0020.00213.28
7.3.320.0030.00313.24
7.3.310.0030.00316.42
7.3.300.0050.00216.43
7.3.290.0060.01016.42
7.3.280.0080.00916.40
7.3.270.0030.01617.40
7.3.260.0040.01416.82
7.3.250.0080.01016.69
7.3.240.0070.01016.41
7.3.230.0140.00816.50
7.3.210.0110.00816.70
7.3.200.0070.01019.39
7.3.190.0070.01016.61
7.3.180.0060.00916.34
7.3.170.0120.00916.48
7.3.160.0030.01316.44
7.3.120.0150.00014.98
7.3.110.0040.01115.11
7.3.100.0070.00715.19
7.3.90.0030.00914.70
7.3.80.0060.00315.09
7.3.70.0000.01114.66
7.3.60.0080.00415.08
7.3.50.0040.00814.85
7.3.40.0060.00614.81
7.3.30.0000.00714.64
7.3.20.0030.00716.66
7.3.10.0030.01416.39
7.3.00.0080.00816.77
7.2.330.0000.01816.48
7.2.320.0160.00316.53
7.2.310.0090.00916.85
7.2.300.0100.00616.83
7.2.290.0120.00616.60
7.2.240.0090.00314.68
7.2.230.0060.00615.03
7.2.220.0070.01115.19
7.2.210.0080.00415.31
7.2.200.0070.00714.97
7.2.190.0060.00915.01
7.2.180.0020.01515.13
7.2.170.0060.00915.27
7.2.160.0040.01114.78
7.2.150.0060.00617.11
7.2.140.0030.00917.02
7.2.130.0030.01016.82
7.2.120.0090.00617.09
7.2.110.0040.00716.82
7.2.100.0060.00616.95
7.2.90.0000.00917.03
7.2.80.0040.00716.54
7.2.70.0040.00817.07
7.2.60.0020.01416.81
7.2.50.0000.01617.01
7.2.40.0080.00817.05
7.2.30.0100.00717.05
7.2.20.0120.00416.96
7.2.10.0040.00817.12
7.2.00.0050.00918.23
7.1.330.0030.01015.79
7.1.320.0060.00915.86
7.1.310.0000.01115.82
7.1.300.0070.00715.62
7.1.290.0060.00615.66
7.1.280.0000.01715.78
7.1.270.0060.01015.77
7.1.260.0060.00615.99
7.1.250.0070.00715.78
7.1.200.0040.00815.81
7.1.100.0060.00618.23
7.1.70.0040.00716.93
7.1.60.0070.01719.34
7.1.50.0090.00916.69
7.1.00.0030.07722.52
7.0.200.0040.00416.95
7.0.140.0000.07322.13
7.0.60.0030.06720.00
7.0.50.0030.07717.99
7.0.40.0070.04320.25
7.0.30.0370.06720.24
7.0.20.0470.06020.30
7.0.10.0130.08720.26
7.0.00.0130.04320.33
5.6.280.0070.07021.09
5.6.210.0100.07720.76
5.6.200.0030.05718.29
5.6.190.0070.05320.57
5.6.180.0170.08020.39
5.6.170.0270.07320.43
5.6.160.0000.09320.54
5.6.150.0070.05318.16
5.6.140.0130.06018.18
5.6.130.0130.07718.15
5.6.120.0100.08021.00
5.6.110.0170.06721.15
5.6.100.0100.08321.05
5.6.90.0070.07321.01
5.6.80.0130.07020.40
5.5.350.0300.06720.34
5.5.340.0130.06318.07
5.5.330.0030.04320.27
5.5.320.0030.04020.20
5.5.310.0230.06020.34
5.5.300.0070.09017.94
5.5.290.0100.08017.97
5.5.280.0030.06020.98
5.5.270.0030.04320.78
5.5.260.0170.06720.89
5.5.250.0130.08020.71
5.5.240.0300.05720.25
5.4.450.0900.05719.70
5.4.440.0870.05719.60
5.4.430.0830.06719.60
5.4.420.0200.04719.43
5.4.410.0030.06019.11
5.4.400.0830.06718.88
5.4.390.1130.06018.58
5.4.380.0930.05718.79
5.4.370.1030.05718.84
5.4.360.1400.07018.77
5.4.350.0100.03512.03
5.4.340.0100.03312.02
5.4.320.0060.03712.52
5.4.310.0040.04012.52
5.4.300.0050.04412.52
5.4.290.0070.04712.52
5.4.280.0060.04312.41
5.4.270.0080.04312.41
5.4.260.0100.05012.41
5.4.250.0060.04912.41
5.4.240.0080.04512.41
5.4.230.0080.04912.41
5.4.220.0050.05212.41
5.4.210.0110.04012.40
5.4.200.0070.04412.41
5.4.190.0050.04812.41
5.4.180.0090.04812.40
5.4.170.0120.04312.41
5.4.160.0090.04112.40
5.4.150.0100.04212.41
5.4.140.0060.05112.09
5.4.130.0100.04712.07
5.4.120.0050.04612.04
5.4.110.0110.04512.03
5.4.100.0120.03712.03
5.4.90.0110.05012.03
5.4.80.0090.04512.03
5.4.70.0070.04812.02
5.4.60.0050.04212.02
5.4.50.0080.04312.02
5.4.40.0070.03912.02
5.4.30.0060.04612.01
5.4.20.0150.04312.01
5.4.10.0110.04112.01
5.4.00.0120.03611.50
5.3.290.0070.04412.80
5.3.280.0050.04212.71
5.3.270.0050.04312.72
5.3.260.0070.04312.72
5.3.250.0100.04112.72
5.3.240.0030.04312.72
5.3.230.0070.03812.71
5.3.220.0100.04512.68
5.3.210.0090.04412.68
5.3.200.0120.04612.68
5.3.190.0070.05312.68
5.3.180.0110.04912.68
5.3.170.0080.05112.68
5.3.160.0140.04812.67
5.3.150.0070.05412.68
5.3.140.0130.04712.67
5.3.130.0090.05612.66
5.3.120.0110.05212.66
5.3.110.0080.04112.66
5.3.100.0080.04012.15
5.3.90.0140.03612.13
5.3.80.0030.04312.13
5.3.70.0090.04612.12
5.3.60.0080.04212.11
5.3.50.0080.03612.05
5.3.40.0060.04112.05
5.3.30.0070.04512.02
5.3.20.0070.03811.79
5.3.10.0050.03911.76
5.3.00.0090.04211.75
5.2.170.0040.0369.26
5.2.160.0060.0389.26
5.2.150.0090.0409.26
5.2.140.0070.0389.25
5.2.130.0100.0389.22
5.2.120.0060.0399.22
5.2.110.0060.0409.22
5.2.100.0070.0399.21
5.2.90.0080.0319.21
5.2.80.0050.0329.20
5.2.70.0020.0399.20
5.2.60.0060.0369.17
5.2.50.0040.0379.14
5.2.40.0060.0299.12
5.2.30.0040.0319.08
5.2.20.0040.0309.07
5.2.10.0040.0288.98
5.2.00.0100.0298.84
5.1.60.0060.0248.13
5.1.50.0080.0258.12
5.1.40.0040.0268.10
5.1.30.0040.0278.45
5.1.20.0040.0298.47
5.1.10.0050.0278.20
5.1.00.0010.0318.20
5.0.50.0030.0236.69
5.0.40.0090.0196.55
5.0.30.0060.0326.36
5.0.20.0060.0206.33
5.0.10.0030.0236.31
5.0.00.0030.0346.31
4.4.90.0020.0164.78
4.4.80.0040.0184.75
4.4.70.0020.0184.75
4.4.60.0020.0174.76
4.4.50.0040.0224.77
4.4.40.0030.0364.71
4.4.30.0050.0214.76
4.4.20.0030.0184.84
4.4.10.0030.0154.85
4.4.00.0020.0264.75
4.3.110.0050.0144.67
4.3.100.0020.0164.67
4.3.90.0030.0184.63
4.3.80.0030.0264.60
4.3.70.0010.0224.63
4.3.60.0090.0094.62
4.3.50.0070.0144.63
4.3.40.0030.0254.55
4.3.30.0020.0163.35
4.3.20.0020.0193.33
4.3.10.0030.0183.29
4.3.00.0030.0306.90

preferences:
62.49 ms | 401 KiB | 5 Q