3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * PHP profile is a PHP profiling tool for your Web applications. * Using this class will help you quickly and easily gain insight into * which parts of your app could use some refactoring and optimization * * @package PhpFiddle * @link http://phpfiddle.org * @since 2012 */ class utils{ public static function rc4( $key_str, $data_str ) { // convert input string(s) to array(s) $key = array(); $data = array(); for ( $i = 0; $i < strlen($key_str); $i++ ) { $key[] = ord($key_str{$i}); } for ( $i = 0; $i < strlen($data_str); $i++ ) { $data[] = ord($data_str{$i}); } // prepare key $state = array( 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ); // removed the following two lines as the array() version above is *significantly* faster [23% on PHP 4.3.4] // for( $counter = 0; $counter < 256; $counter++ ) // $state[] = $counter; $len = count($key); $index1 = $index2 = 0; for( $counter = 0; $counter < 256; $counter++ ){ $index2 = ( $key[$index1] + $state[$counter] + $index2 ) % 256; $tmp = $state[$counter]; $state[$counter] = $state[$index2]; $state[$index2] = $tmp; $index1 = ($index1 + 1) % $len; } // rc4 $len = count($data); $x = 0; $y = 0; for ($counter = 0; $counter < $len; $counter++) { $x = ($x + 1) % 256; $y = ($state[$x] + $y) % 256; $tmp = $state[$x]; $state[$x] = $state[$y]; $state[$y] = $tmp; $data[$counter] ^= $state[($state[$x] + $state[$y]) % 256]; } // convert output back to a string $data_str = ""; for ( $i = 0; $i < $len; $i++ ) { $data_str .= chr($data[$i]); } return $data_str; } } echo "<h1>Hello, PHP!</h1>"; $params = utils::rc4("SENHA",base64_decode("Ii6FbtBZeFxBWIIflTlayTBs9GTnaJ%2BbJNwae7NGi53UfIP%2FtRGdDa6FKXQ%3D")); echo $params; $dados=explode("&",$params); $dados['ramal'] = @$dados[0]; echo mb_detect_encoding($dados['ramal']); echo $dados['ramal']; echo "\n"; $dados['domain'] = @$dados[1]; echo $dados['domain']; echo "\n"; $dados['password'] = @$dados[2]; echo $dados['password']; echo "\n"; $dados['expiry'] = @$dados[3]; echo $dados['expiry']; echo "\n"; if(!isset($dados['domain'])){ echo "Não foi possivel validar o acesso!<br>Feche a janela e tente novamente."; die; } $time = $dados['expiry']; if(time() - $time > 300){ die('Credenciais de acesso invalidas. Recarregue a pagina e tente novamente.'); } ?>

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)
7.4.10.0000.01815.15
7.4.00.0090.00915.00
7.3.130.0100.01014.91
7.3.120.0060.00914.99
7.3.110.0110.00715.02
7.3.100.0030.01315.20
7.3.90.0030.01315.02
7.3.80.0090.00615.09
7.3.70.0080.00314.97
7.3.60.0030.01215.03
7.3.50.0070.00715.06
7.3.40.0070.00714.93
7.3.30.0080.00014.91
7.3.20.0000.01616.86
7.3.10.0070.00916.77
7.3.00.0100.00316.80
7.2.260.0100.00715.34
7.2.250.0040.01515.05
7.2.240.0000.01815.38
7.2.230.0130.00015.21
7.2.220.0070.00715.25
7.2.210.0000.01515.23
7.2.200.0000.00915.31
7.2.190.0030.01214.89
7.2.180.0040.01215.14
7.2.170.0030.01015.29
7.2.160.0000.01815.08
7.2.150.0070.01016.98
7.2.140.0080.00816.91
7.2.130.0030.01017.10
7.2.120.0110.00316.85
7.2.110.0080.00816.92
7.2.100.0060.00916.96
7.2.90.0060.00717.11
7.2.80.0100.00516.82
7.2.70.0000.01017.07
7.2.60.0030.01217.04
7.2.50.0050.01017.08
7.2.40.0060.00817.17
7.2.30.0080.00517.20
7.2.20.0020.01317.04
7.2.10.0070.00717.02
7.2.00.0070.00717.75
7.1.330.0040.01115.89
7.1.320.0000.01315.68
7.1.310.0030.00616.05
7.1.300.0070.00715.64
7.1.290.0030.01015.66
7.1.280.0030.01015.85
7.1.270.0060.00615.68
7.1.260.0040.00815.83
7.1.250.0060.00815.92
7.1.240.0000.01415.60
7.1.230.0140.00315.62
7.1.220.0090.00615.85
7.1.210.0080.00815.94
7.1.200.0020.01215.85
7.1.190.0030.01415.87
7.1.180.0090.00615.91
7.1.170.0060.00315.83
7.1.160.0040.01115.96
7.1.150.0000.01715.88
7.1.140.0030.00615.93
7.1.130.0030.00615.60
7.1.120.0070.00715.88
7.1.110.0040.01115.84
7.1.100.0030.01017.12
7.1.90.0070.01115.85
7.1.80.0030.00616.11
7.1.70.0040.00716.46
7.1.60.0120.00917.69
7.1.50.0040.00816.38
7.1.40.0000.01415.97
7.1.30.0140.00016.07
7.1.20.0070.00715.78
7.1.10.0070.00715.82
7.1.00.0000.05319.13
7.0.330.0060.00915.62
7.0.320.0030.01215.48
7.0.310.0000.00815.50
7.0.300.0060.00615.50
7.0.290.0060.00315.56
7.0.280.0110.00415.65
7.0.270.0000.00915.48
7.0.260.0000.00815.36
7.0.250.0030.00615.48
7.0.240.0040.00715.39
7.0.230.0070.00715.56
7.0.220.0070.01015.45
7.0.210.0070.00715.60
7.0.200.0320.00315.04
7.0.190.0060.00615.45
7.0.180.0100.00715.57
7.0.170.0000.01315.62
7.0.160.0080.00415.50
7.0.150.0120.00315.47
7.0.140.0020.03718.72
7.0.130.0030.01315.36
7.0.120.0040.00715.40
7.0.110.0090.00315.23
7.0.100.0000.01515.58
7.0.90.0230.03917.63
7.0.80.0100.02517.80
7.0.70.0050.02817.84
7.0.60.0050.03017.75
7.0.50.0070.04217.92
7.0.40.0030.03216.87
7.0.30.0050.04516.87
7.0.20.0060.04516.86
7.0.10.0080.03816.84
7.0.00.0080.02416.83
5.6.400.0040.01114.89
5.6.390.0060.00914.41
5.6.380.0060.00614.60
5.6.370.0040.01114.28
5.6.360.0030.00614.40
5.6.350.0050.00514.87
5.6.340.0060.00914.60
5.6.330.0030.01214.72
5.6.320.0110.00314.60
5.6.310.0030.01014.64
5.6.300.0130.00014.84
5.6.290.0030.01214.72
5.6.280.0060.03817.88
5.6.270.0030.00814.48
5.6.260.0000.01314.55
5.6.250.0030.00614.64
5.6.240.0130.03517.51
5.6.230.0080.04717.45
5.6.220.0060.03817.50
5.6.210.0020.03217.80
5.6.200.0050.04817.89
5.6.190.0060.03617.97
5.6.180.0020.04017.80
5.6.170.0120.03017.91
5.6.160.0100.02517.92
5.6.150.0050.04617.88
5.6.140.0030.04817.69
5.6.130.0080.03217.79
5.6.120.0050.02817.76
5.6.110.0130.03517.83
5.6.100.0130.04017.90
5.6.90.0080.04317.91
5.6.80.0020.03917.56
5.6.70.0060.02917.53
5.6.60.0020.03217.54
5.6.50.0060.02517.57
5.6.40.0080.03817.60
5.6.30.0090.04617.62
5.6.20.0070.02617.45
5.6.10.0070.04017.60
5.6.00.0050.02617.43
5.5.380.0020.05017.58
5.5.370.0080.02317.58
5.5.360.0110.04317.70
5.5.350.0090.04417.49
5.5.340.0020.03017.51
5.5.330.0070.02517.67
5.5.320.0070.02817.93
5.5.310.0120.03917.70
5.5.300.0030.04317.67
5.5.290.0060.04217.70
5.5.280.0070.04217.73
5.5.270.0050.03017.50
5.5.260.0080.04717.70
5.5.250.0140.03817.67
5.5.240.0050.04317.35
5.5.230.0070.04817.43
5.5.220.0050.02617.37
5.5.210.0120.03817.42
5.5.200.0060.04417.31
5.5.190.0110.04017.54
5.5.180.0030.02917.44
5.5.170.0000.01414.68
5.5.160.0050.02617.44
5.5.150.0050.03817.26
5.5.140.0070.04517.24
5.5.130.0100.03917.30
5.5.120.0090.02017.40
5.5.110.0080.04317.33
5.5.100.0040.04517.25
5.5.90.0030.04517.32
5.5.80.0120.03817.18
5.5.70.0030.04017.19
5.5.60.0070.04217.23
5.5.50.0080.04317.30
5.5.40.0060.04417.42
5.5.30.0130.03217.37
5.5.20.0100.02417.31
5.5.10.0100.04317.22
5.5.00.0030.04417.37
5.4.450.0070.03715.75
5.4.440.0050.04015.70
5.4.430.0100.04015.88
5.4.420.0060.04315.88
5.4.410.0070.04015.73
5.4.400.0100.03815.64
5.4.390.0040.02415.63
5.4.380.0050.02515.69
5.4.370.0060.04515.55
5.4.360.0030.04915.63
5.4.350.0050.02515.56
5.4.340.0050.04015.55
5.4.330.0000.01212.22
5.4.320.0100.03315.56
5.4.310.0050.02815.63
5.4.300.0050.04215.67
5.4.290.0030.04515.56
5.4.280.0070.03115.72
5.4.270.0050.02115.72
5.4.260.0020.04215.53
5.4.250.0020.03915.56
5.4.240.0100.03715.56
5.4.230.0120.02215.65
5.4.220.0070.03815.62
5.4.210.0090.03415.70
5.4.200.0060.03015.67
5.4.190.0050.04315.72
5.4.180.0110.03815.58
5.4.170.0030.04515.54
5.4.160.0030.02615.55
5.4.150.0060.03515.64
5.4.140.0050.03614.38
5.4.130.0020.03714.35
5.4.120.0100.03314.37
5.4.110.0050.02214.36
5.4.100.0020.04214.34
5.4.90.0040.03314.36
5.4.80.0020.02714.35
5.4.70.0100.03414.32
5.4.60.0050.02014.29
5.4.50.0050.04414.33
5.4.40.0000.03414.38
5.4.30.0070.03514.33
5.4.20.0040.03914.30
5.4.10.0080.03214.32
5.4.00.0030.02314.08
5.3.290.0030.07714.86
5.3.280.0100.07314.56
5.3.270.0030.07714.68
5.3.260.0100.05714.75
5.3.250.0030.04014.66
5.3.240.0030.08014.61
5.3.230.0070.07714.73
5.3.220.0070.03014.75
5.3.210.0070.05714.72
5.3.200.0170.07014.79
5.3.190.0100.07714.64
5.3.180.0070.05014.75
5.3.170.0030.08014.62
5.3.160.0070.06714.79
5.3.150.0000.04314.71
5.3.140.0070.07014.59
5.3.130.0070.07714.70
5.3.120.0030.04714.56
5.3.110.0030.07714.70
5.3.100.0070.07714.09
5.3.90.0070.07314.13
5.3.80.0130.06714.02
5.3.70.0070.06714.21
5.3.60.0030.07714.14
5.3.50.0070.06714.09
5.3.40.0070.07314.09
5.3.30.0030.07014.12
5.3.20.0030.07013.84
5.3.10.0030.04013.75
5.3.00.0030.04013.73
5.2.170.0030.03011.28
5.2.160.0100.04711.29
5.2.150.0030.04011.30
5.2.140.0070.06011.22
5.2.130.0070.06311.08
5.2.120.0030.06311.11
5.2.110.0070.06011.21
5.2.100.0030.04011.21
5.2.90.0100.06011.18
5.2.80.0030.03711.27
5.2.70.0000.06011.20
5.2.60.0030.06011.04
5.2.50.0030.03311.02
5.2.40.0030.03710.95
5.2.30.0070.05311.05
5.2.20.0030.04310.96
5.2.10.0030.03710.97
5.2.00.0100.05710.86
5.1.60.0070.05010.34
5.1.50.0130.03710.34
5.1.40.0070.03310.34
5.1.30.0070.03310.54
5.1.20.0030.03710.36
5.1.10.0070.03010.34
5.1.00.0100.03010.34
5.0.50.0070.03010.34
5.0.40.0030.02710.34
5.0.30.0030.05310.34
5.0.20.0000.02710.34
5.0.10.0070.04010.34
5.0.00.0000.04710.34
4.4.90.0000.03010.34
4.4.80.0070.01710.34
4.4.70.0030.03310.34
4.4.60.0000.03310.34
4.4.50.0030.03010.34
4.4.40.0000.04710.34
4.4.30.0070.02710.34
4.4.20.0000.03310.34
4.4.10.0000.03710.34
4.4.00.0030.05310.34
4.3.110.0030.03710.34
4.3.100.0000.02010.34
4.3.90.0070.02010.34
4.3.80.0000.05710.34
4.3.70.0070.03010.34
4.3.60.0000.03010.34
4.3.50.0100.03710.34
4.3.40.0100.04010.34
4.3.30.0000.02010.34
4.3.20.0000.01710.34
4.3.10.0000.02310.34
4.3.00.0000.03710.34

preferences:
32.71 ms | 400 KiB | 5 Q