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; } } $ramal="03193021130"; $ip="192.168.100.27"; $porta="5432"; $password="atitude05"; echo @$ramal."&".$ip.":".$porta."&".$password."&".time(); echo "\n"; echo date('Y-m-d H:i:s', time()); echo "\n"; $parametro=base64_encode( utils::rc4( 'admin123', @$ramal."&".$ip.":".$porta."&".$password."&".time())); echo $parametro; echo "\n"; echo "<h1>Hello, PHP!</h1>"; $params = utils::rc4('admin123',base64_decode($parametro)); echo $params; $dados=explode("&",$params); echo "\n"; $dados['ramal'] = @$dados[0]; 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.3.10.0050.00816.79
7.3.00.0100.00316.84
7.2.130.0060.01017.05
7.2.120.0040.01116.82
7.2.110.0060.01016.64
7.2.100.0030.01216.76
7.2.90.0030.00916.93
7.2.80.0040.01116.93
7.2.70.0030.00717.02
7.2.60.0060.00616.97
7.2.50.0120.00316.89
7.2.40.0090.00516.70
7.2.30.0000.01316.93
7.2.20.0070.00716.95
7.2.10.0140.00016.96
7.2.00.0070.00518.27
7.1.250.0030.01315.99
7.1.240.0060.00315.63
7.1.230.0040.01115.79
7.1.220.0000.01115.88
7.1.210.0130.00315.93
7.1.200.0030.01015.87
7.1.190.0070.00315.83
7.1.180.0060.00315.44
7.1.170.0040.00815.95
7.1.160.0070.00715.90
7.1.150.0040.01415.70
7.1.140.0120.00415.74
7.1.130.0070.00715.75
7.1.120.0090.00915.86
7.1.110.0000.01215.62
7.1.100.0090.00716.99
7.1.90.0030.00715.83
7.1.80.0040.01115.66
7.1.70.0030.00916.63
7.1.60.0000.01717.82
7.1.50.0090.00616.32
7.1.40.0080.00615.62
7.1.30.0030.01015.88
7.1.20.0000.01115.71
7.1.10.0080.00615.53
7.1.00.0020.05518.99
7.0.330.0030.00615.21
7.0.320.0150.00015.59
7.0.310.0030.00715.54
7.0.300.0100.00015.65
7.0.290.0030.00615.35
7.0.280.0060.00915.37
7.0.270.0070.00715.39
7.0.260.0040.00815.37
7.0.250.0100.00715.14
7.0.240.0110.00415.51
7.0.230.0030.01015.25
7.0.220.0030.01015.31
7.0.210.0040.01115.31
7.0.200.0100.00415.15
7.0.190.0060.00315.42
7.0.180.0000.01415.54
7.0.170.0070.00715.43
7.0.160.0030.01015.44
7.0.150.0070.00715.23
7.0.140.0040.04318.72
7.0.130.0060.00615.54
7.0.120.0000.00715.64
7.0.110.0040.01115.40
7.0.100.0040.02417.68
7.0.90.0080.02017.75
7.0.80.0080.01817.73
7.0.70.0070.02217.61
7.0.60.0060.04717.70
7.0.50.0030.05117.96
7.0.40.0050.03216.55
7.0.30.0040.02616.82
7.0.20.0080.02516.86
7.0.10.0030.03216.80
7.0.00.0000.04316.75
5.6.380.0040.01414.62
5.6.370.0090.00614.70
5.6.360.0040.01214.65
5.6.350.0070.01114.33
5.6.340.0080.00814.54
5.6.330.0060.01014.81
5.6.320.0000.01014.59
5.6.310.0070.00814.19
5.6.300.0060.00914.58
5.6.290.0030.01214.45
5.6.280.0030.04817.71
5.6.270.0070.00314.40
5.6.260.0000.01614.34
5.6.250.0050.02617.56
5.6.240.0030.02717.43
5.6.230.0040.04317.51
5.6.220.0090.01917.58
5.6.210.0050.04317.54
5.6.200.0090.04517.85
5.6.190.0020.05217.92
5.6.180.0080.04517.89
5.6.170.0080.02717.66
5.6.160.0080.04217.93
5.6.150.0130.03717.89
5.6.140.0120.04017.92
5.6.130.0070.02717.76
5.6.120.0070.02717.76
5.6.110.0170.03317.74
5.6.100.0130.03817.81
5.6.90.0080.04017.86
5.6.80.0130.02417.51
5.6.70.0050.04417.66
5.6.60.0050.04517.53
5.6.50.0050.04517.49
5.6.40.0050.02717.68
5.6.30.0100.04117.62
5.6.20.0070.03717.59
5.6.10.0100.03517.46
5.6.00.0030.04517.38
5.5.380.0050.02615.83
5.5.370.0000.02715.92
5.5.360.0060.02915.91
5.5.350.0030.02015.94
5.5.340.0050.03216.15
5.5.330.0080.04616.12
5.5.320.0060.03716.23
5.5.310.0050.04216.15
5.5.300.0070.04715.99
5.5.290.0080.02516.20
5.5.280.0070.04316.12
5.5.270.0030.04615.96
5.5.260.0040.05016.06
5.5.250.0050.04516.03
5.5.240.0030.03415.72
5.5.230.0070.02515.72
5.5.220.0070.03515.64
5.5.210.0080.03815.76
5.5.200.0030.04515.69
5.5.190.0050.03315.82
5.5.180.0020.03215.63
5.5.170.0040.01111.40
5.5.160.0050.03915.50
5.5.150.0070.02815.69
5.5.140.0050.02915.86
5.5.130.0100.03515.78
5.5.120.0180.03015.84
5.5.110.0040.02615.76
5.5.100.0090.03915.83
5.5.90.0030.05015.53
5.5.80.0070.04215.73
5.5.70.0060.04115.74
5.5.60.0090.03515.55
5.5.50.0030.02915.81
5.5.40.0100.04115.75
5.5.30.0070.04315.67
5.5.20.0080.03815.71
5.5.10.0050.04815.70
5.5.00.0070.04515.65
5.4.450.0020.02815.50
5.4.440.0050.03715.14
5.4.430.0070.03815.51
5.4.420.0090.03515.29
5.4.410.0050.03514.93
5.4.400.0050.03915.09
5.4.390.0040.04315.03
5.4.380.0100.03815.11
5.4.370.0070.03915.17
5.4.360.0030.02615.13
5.4.350.0090.02415.02
5.4.340.0020.04215.02
5.4.330.0000.01211.52
5.4.320.0060.03015.10
5.4.310.0050.04415.17
5.4.300.0030.02715.23
5.4.290.0050.04015.21
5.4.280.0000.03015.20
5.4.270.0050.02715.29
5.4.260.0000.04515.37
5.4.250.0050.03915.01
5.4.240.0080.04015.11
5.4.230.0030.04515.24
5.4.220.0070.04215.15
5.4.210.0020.04715.16
5.4.200.0070.03815.37
5.4.190.0070.04015.06
5.4.180.0050.03615.07
5.4.170.0070.04215.15
5.4.160.0120.03715.14
5.4.150.0080.02115.12
5.4.140.0080.03113.91
5.4.130.0050.02913.80
5.4.120.0030.04013.90
5.4.110.0070.04113.73
5.4.100.0070.04013.91
5.4.90.0020.04413.88
5.4.80.0040.02513.81
5.4.70.0030.03513.79
5.4.60.0050.03513.80
5.4.50.0030.04013.88
5.4.40.0080.03613.82
5.4.30.0100.02814.02
5.4.20.0020.02513.92
5.4.10.0050.04313.89
5.4.00.0050.03113.43
5.3.290.0030.03512.79
5.3.280.0090.03612.74
5.3.270.0050.03912.68
5.3.260.0000.04412.86
5.3.250.0030.04212.83
5.3.240.0090.03712.76
5.3.230.0030.03812.87
5.3.220.0080.03612.75
5.3.210.0050.04012.76
5.3.200.0090.03012.81
5.3.190.0050.04712.83
5.3.180.0030.03512.85
5.3.170.0040.04012.84
5.3.160.0100.03712.82
5.3.150.0080.03712.80
5.3.140.0020.03612.76
5.3.130.0020.02712.76
5.3.120.0030.02512.83
5.3.110.0050.03712.68
5.3.100.0070.02012.53
5.3.90.0070.04012.51
5.3.80.0020.04912.36
5.3.70.0150.03012.47
5.3.60.0080.02712.35
5.3.50.0010.03612.52
5.3.40.0060.04112.40
5.3.30.0080.03612.57
5.3.20.0020.02512.33
5.3.10.0050.03712.19
5.3.00.0030.03512.25
5.2.170.0020.03811.02
5.2.160.0030.02910.92
5.2.150.0000.02410.93
5.2.140.0070.03110.92
5.2.130.0000.03711.00
5.2.120.0020.03611.02
5.2.110.0070.03111.01
5.2.100.0070.02810.91
5.2.90.0050.03411.01
5.2.80.0030.03610.92
5.2.70.0100.02910.98
5.2.60.0040.03410.97
5.2.50.0080.01810.93
5.2.40.0070.02310.94
5.2.30.0050.03410.94
5.2.20.0020.03010.86
5.2.10.0030.02810.89
5.2.00.0070.01710.72
5.1.60.0030.02910.55
5.1.50.0070.02010.55
5.1.40.0010.01610.55
5.1.30.0030.03110.55
5.1.20.0020.02910.64
5.1.10.0020.03610.55
5.1.00.0030.02910.55
5.0.50.0020.02710.55
5.0.40.0040.01410.55
5.0.30.0050.03410.55
5.0.20.0050.02510.55
5.0.10.0030.02510.55
5.0.00.0020.03810.55
4.4.90.0000.02210.55
4.4.80.0030.01610.55
4.4.70.0020.01210.55
4.4.60.0030.02010.55
4.4.50.0020.02010.55
4.4.40.0050.02510.55
4.4.30.0000.01510.55
4.4.20.0020.01810.55
4.4.10.0000.01210.55
4.4.00.0030.02210.55
4.3.110.0030.01010.55
4.3.100.0000.01710.55
4.3.90.0020.01910.55
4.3.80.0020.01510.55
4.3.70.0020.01710.55
4.3.60.0030.01810.55
4.3.50.0000.01210.55
4.3.40.0030.02610.55
4.3.30.0030.01010.55
4.3.20.0000.01410.55
4.3.10.0010.01910.55
4.3.00.0000.02110.55

preferences:
37.65 ms | 400 KiB | 5 Q