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_convert_encoding($dados['ramal'], "ISO-8859-1", mb_detect_encoding($dados['ramal'], "auto")); 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']; echo $time; 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.00.0040.01515.45
7.3.120.0060.00915.09
7.3.110.0090.00814.98
7.3.100.0080.00715.07
7.3.90.0080.00615.13
7.3.80.0050.01115.22
7.3.70.0070.00714.95
7.3.60.0080.00414.79
7.3.50.0040.00914.93
7.3.40.0050.00815.19
7.3.30.0050.00815.10
7.3.20.0070.00416.93
7.3.10.0080.00216.74
7.3.00.0050.00716.76
7.2.250.0100.01015.14
7.2.240.0100.00815.46
7.2.230.0030.01215.32
7.2.220.0050.01015.19
7.2.210.0040.01115.47
7.2.200.0020.01515.42
7.2.190.0050.00815.22
7.2.180.0050.01115.43
7.2.170.0030.01115.37
7.2.160.0030.01214.99
7.2.150.0060.00916.68
7.2.140.0060.00917.13
7.2.130.0130.00316.79
7.2.120.0120.00317.04
7.2.110.0100.00716.82
7.2.100.0060.00916.94
7.2.90.0070.01117.12
7.2.80.0040.01117.04
7.2.70.0030.00916.97
7.2.60.0080.00617.02
7.2.50.0070.01016.88
7.2.40.0100.00716.63
7.2.30.0000.01516.89
7.2.20.0070.00717.19
7.2.10.0000.01416.97
7.2.00.0060.01118.40
7.1.330.0030.00815.89
7.1.320.0020.00915.81
7.1.310.0070.00915.99
7.1.300.0050.00815.80
7.1.290.0000.01315.94
7.1.280.0090.00416.01
7.1.270.0060.00816.08
7.1.260.0060.00715.88
7.1.250.0100.00715.86
7.1.200.0070.00715.89
7.1.100.0030.01018.40
7.1.70.0080.00017.34
7.1.60.0060.01319.50
7.1.50.0240.01435.00
7.1.00.0000.08022.34
7.0.200.0780.00714.86
7.0.140.0030.06722.21
7.0.100.0100.06020.24
7.0.90.0170.04020.04
7.0.80.0030.06320.00
7.0.70.0070.06719.98
7.0.60.0070.05020.03
7.0.50.0200.03720.39
7.0.40.0000.03720.10
7.0.30.0100.03720.04
7.0.20.0070.04020.11
7.0.10.0030.03720.09
7.0.00.0100.03720.06
5.6.280.0070.07021.13
5.6.250.0000.05320.81
5.6.240.0030.09020.70
5.6.230.0100.08320.71
5.6.220.0030.08020.73
5.6.210.0100.06320.82
5.6.200.0000.05321.17
5.6.190.0000.04321.04
5.6.180.0030.04321.08
5.6.170.0070.04021.09
5.6.160.0100.03321.03
5.6.150.0070.04320.98
5.6.140.0000.04720.93
5.6.130.0000.04021.15
5.6.120.0000.05321.07
5.6.110.0030.04321.05
5.6.100.0130.02721.04
5.6.90.0100.03721.14
5.6.80.0030.04020.51
5.6.70.0000.04320.43
5.6.60.0100.02720.37
5.6.50.0070.03020.50
5.6.40.0100.03720.37
5.6.30.0030.04020.44
5.6.20.0100.03320.35
5.6.10.0070.04320.51
5.6.00.0070.03720.50
5.5.380.0000.09020.42
5.5.370.0130.05720.46
5.5.360.0070.08020.41
5.5.350.0070.06720.46
5.5.340.0030.04320.82
5.5.330.0000.04720.99
5.5.320.0070.05320.97
5.5.310.0030.04320.88
5.5.300.0070.03320.88
5.5.290.0000.05320.82
5.5.280.0030.04320.97
5.5.270.0070.04020.90
5.5.260.0030.04320.78
5.5.250.0000.03720.69
5.5.240.0070.03320.08
5.5.230.0130.02720.20
5.5.220.0070.03320.32
5.5.210.0070.03720.26
5.5.200.0130.03320.31
5.5.190.0030.03320.32
5.5.180.0000.03720.30
5.5.160.0070.03720.25
5.5.150.0030.04020.26
5.5.140.0070.03720.18
5.5.130.0030.05020.18
5.5.120.0070.03320.20
5.5.110.0030.04320.13
5.5.100.0000.06720.23
5.5.90.0030.07320.22
5.5.80.0030.08719.96
5.5.70.0070.06320.11
5.5.60.0130.07020.23
5.5.50.0070.04020.14
5.5.40.0000.05020.20
5.5.30.0100.04720.19
5.5.20.0070.05720.17
5.5.10.0070.08720.16
5.5.00.0100.03720.16
5.4.450.0030.04019.41
5.4.440.0000.04319.54
5.4.430.0030.03319.44
5.4.420.0030.03719.43
5.4.410.0030.03319.41
5.4.400.0070.02718.90
5.4.390.0070.03018.87
5.4.380.0170.02319.16
5.4.370.0070.03019.02
5.4.360.0000.04018.90
5.4.350.0030.04719.04
5.4.340.0000.03719.04
5.4.320.0100.03318.93
5.4.310.0000.04019.20
5.4.300.0030.03319.05
5.4.290.0000.04319.02
5.4.280.0030.04019.02
5.4.270.0030.08319.17
5.4.260.0000.08319.04
5.4.250.0100.07319.04
5.4.240.0000.08319.17
5.4.230.0130.06719.07
5.4.220.0000.08019.03
5.4.210.0070.07019.16
5.4.200.0030.07718.89
5.4.190.0030.08019.14
5.4.180.0130.06719.02
5.4.170.0100.05319.19
5.4.160.0000.04719.00
5.4.150.0100.06719.10
5.4.140.0070.06016.43
5.4.130.0100.02716.41
5.4.120.0100.06716.41
5.4.110.0070.04716.56
5.4.100.0100.03316.41
5.4.90.0070.05016.56
5.4.80.0100.05316.54
5.4.70.0030.07016.54
5.4.60.0070.03316.47
5.4.50.0100.06016.51
5.4.40.0100.06716.38
5.4.30.0070.03016.29
5.4.20.0030.08016.50
5.4.10.0070.07016.56
5.4.00.0100.04715.87
5.3.290.0070.02714.88
5.3.280.0030.03714.67
5.3.270.0030.07714.84
5.3.260.0100.07314.71
5.3.250.0000.06314.68
5.3.240.0100.06314.67
5.3.230.0000.03714.78
5.3.220.0100.07014.77
5.3.210.0100.03314.59
5.3.200.0200.05314.79
5.3.190.0030.04014.58
5.3.180.0070.06014.79
5.3.170.0000.03714.68
5.3.160.0070.03714.71
5.3.150.0070.03714.67
5.3.140.0030.05714.74
5.3.130.0100.06714.70
5.3.120.0130.06714.77
5.3.110.0070.07714.72
5.3.100.0170.05714.18
5.3.90.0030.05314.16
5.3.80.0170.05314.08
5.3.70.0100.05714.02
5.3.60.0100.06714.18
5.3.50.0000.06314.06
5.3.40.0030.05014.09
5.3.30.0030.04014.03
5.3.20.0030.06713.70
5.3.10.0100.05713.67
5.3.00.0030.08013.71
5.2.170.0100.06011.64
5.2.160.0070.06011.64
5.2.150.0030.03711.64
5.2.140.0000.06311.64
5.2.130.0070.04711.64
5.2.120.0070.04711.64
5.2.110.0030.03311.64
5.2.100.0100.03011.64
5.2.90.0100.05711.64
5.2.80.0070.04011.64
5.2.70.0070.04311.64
5.2.60.0070.03311.64
5.2.50.0070.06011.64
5.2.40.0070.05011.64
5.2.30.0070.03711.64
5.2.20.0030.04311.64
5.2.10.0100.06011.64
5.2.00.0030.03311.64
5.1.60.0030.05311.64
5.1.50.0070.02711.64
5.1.40.0030.05311.64
5.1.30.0030.03311.64
5.1.20.0030.03011.64
5.1.10.0030.05711.64
5.1.00.0070.05311.64
5.0.50.0100.04311.64
5.0.40.0030.04311.64
5.0.30.0100.05311.64
5.0.20.0000.03011.64
5.0.10.0070.03311.64
5.0.00.0030.06711.64
4.4.90.0000.02711.64
4.4.80.0000.02711.64
4.4.70.0000.02011.64
4.4.60.0000.02011.64
4.4.50.0070.02011.64
4.4.40.0000.03011.64
4.4.30.0070.01311.64
4.4.20.0000.02711.64
4.4.10.0000.03311.64
4.4.00.0000.05011.64
4.3.110.0030.03311.64
4.3.100.0000.02311.64
4.3.90.0030.03011.64
4.3.80.0000.03711.64
4.3.70.0030.01711.64
4.3.60.0000.03711.64
4.3.50.0070.03011.64
4.3.40.0030.04311.64
4.3.30.0070.01311.64
4.3.20.0030.01711.64
4.3.10.0000.02311.64
4.3.00.0000.02311.64

preferences:
29.15 ms | 401 KiB | 5 Q