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="4110"; $ip="192.168.100.27"; $porta="5432"; $password="atitude05"; $parametro=base64_encode( utils::rc4( "SENHA", @$ramal."&".$ip.":".$porta."&".$password."&".time())); echo "<h1>Hello, PHP!</h1>"; $params = utils::rc4("SENHA",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.4.00.0090.00915.05
7.3.120.0110.00714.84
7.3.110.0030.01214.98
7.3.100.0040.01514.99
7.3.90.0070.00715.00
7.3.80.0060.00914.87
7.3.70.0050.00514.99
7.3.60.0080.00814.96
7.3.50.0160.00014.81
7.3.40.0030.00715.00
7.3.30.0040.00414.70
7.3.20.0030.00816.79
7.3.10.0100.00316.80
7.3.00.0030.00916.73
7.2.250.0000.01715.49
7.2.240.0140.00414.99
7.2.230.0000.01715.26
7.2.220.0040.01214.89
7.2.210.0130.00315.41
7.2.200.0100.00715.19
7.2.190.0060.00915.16
7.2.180.0110.00715.34
7.2.170.0090.00615.26
7.2.160.0040.01115.34
7.2.150.0080.00316.77
7.2.140.0120.00316.66
7.2.130.0090.00016.98
7.2.120.0000.01116.90
7.2.110.0030.01016.89
7.2.100.0000.01517.10
7.2.90.0040.01117.02
7.2.80.0070.00717.21
7.2.70.0070.00717.21
7.2.60.0080.00617.12
7.2.50.0000.01316.96
7.2.40.0030.01316.92
7.2.30.0030.01016.82
7.2.20.0040.00716.96
7.2.10.0030.01216.78
7.2.00.0070.00818.20
7.1.330.0000.01315.61
7.1.320.0030.01015.98
7.1.310.0030.00715.55
7.1.300.0060.00815.78
7.1.290.0060.00615.92
7.1.280.0040.00815.61
7.1.270.0060.00615.86
7.1.260.0100.00315.79
7.1.250.0030.00715.73
7.1.240.0030.01015.77
7.1.230.0040.00815.85
7.1.220.0100.00715.92
7.1.210.0040.01215.88
7.1.200.0050.00915.91
7.1.190.0030.01415.72
7.1.180.0030.00915.85
7.1.170.0030.01015.79
7.1.160.0030.00915.78
7.1.150.0030.01015.72
7.1.140.0070.00715.94
7.1.130.0100.00415.72
7.1.120.0070.01115.91
7.1.110.0060.01216.01
7.1.100.0100.00317.03
7.1.90.0110.00415.68
7.1.80.0000.01215.86
7.1.70.0050.00516.52
7.1.60.0120.00617.67
7.1.50.0070.01216.37
7.1.40.0030.01215.63
7.1.30.0030.01015.99
7.1.20.0000.01415.48
7.1.10.0000.01015.84
7.1.00.0080.03718.87
7.0.330.0040.00415.44
7.0.320.0120.00315.48
7.0.310.0060.00615.40
7.0.300.0090.00615.42
7.0.290.0070.01015.19
7.0.280.0100.00715.55
7.0.270.0000.00915.58
7.0.260.0030.01415.41
7.0.250.0060.00315.50
7.0.240.0090.00615.63
7.0.230.0040.01115.34
7.0.220.0040.00815.62
7.0.210.0030.01015.54
7.0.200.0060.00715.20
7.0.190.0100.00315.63
7.0.180.0110.00415.36
7.0.170.0070.01015.31
7.0.160.0060.00615.51
7.0.150.0000.01415.57
7.0.140.0050.04018.74
7.0.130.0000.01115.61
7.0.120.0040.00715.63
7.0.110.0040.00815.37
7.0.100.0100.00315.45
7.0.90.0040.01115.60
7.0.80.0020.03117.80
7.0.70.0060.04217.78
7.0.60.0130.02517.67
7.0.50.0080.04517.93
7.0.40.0090.03616.84
7.0.30.0100.03816.88
7.0.20.0050.04616.80
7.0.10.0060.04616.78
7.0.00.0030.02716.81
5.6.400.0060.00914.35
5.6.390.0070.01014.44
5.6.380.0080.00414.73
5.6.370.0100.00614.50
5.6.360.0030.00614.77
5.6.350.0070.01014.80
5.6.340.0090.00914.57
5.6.330.0030.00614.83
5.6.320.0030.00914.50
5.6.310.0030.01314.77
5.6.300.0090.00914.83
5.6.290.0090.00014.75
5.6.280.0000.01814.69
5.6.270.0070.00714.67
5.6.260.0040.00714.75
5.6.250.0110.00314.73
5.6.240.0120.00414.62
5.6.230.0100.04317.63
5.6.220.0050.04517.70
5.6.210.0120.03517.64
5.6.200.0080.04817.73
5.6.190.0100.04517.90
5.6.180.0070.04717.95
5.6.170.0000.03217.96
5.6.160.0100.02017.69
5.6.150.0060.04417.67
5.6.140.0050.02817.81
5.6.130.0070.02517.85
5.6.120.0070.04617.87
5.6.110.0100.04117.81
5.6.100.0130.02317.82
5.6.90.0120.04017.69
5.6.80.0020.04017.51
5.6.70.0140.03717.52
5.6.60.0050.03117.56
5.6.50.0100.04317.48
5.6.40.0070.04517.34
5.6.30.0070.04217.37
5.6.20.0080.04417.53
5.6.10.0050.04717.48
5.6.00.0030.04517.60
5.5.380.0060.00914.54
5.5.370.0010.04617.41
5.5.360.0070.03617.52
5.5.350.0100.04417.54
5.5.340.0030.03217.84
5.5.330.0120.03717.75
5.5.320.0070.02417.76
5.5.310.0070.03217.66
5.5.300.0070.04517.68
5.5.290.0100.02317.70
5.5.280.0100.04417.61
5.5.270.0060.04617.74
5.5.260.0070.04517.54
5.5.250.0080.04117.49
5.5.240.0110.03817.47
5.5.230.0060.04617.35
5.5.220.0110.03317.49
5.5.210.0070.04317.25
5.5.200.0060.04117.22
5.5.190.0070.04717.43
5.5.180.0070.05017.42
5.5.170.0000.01614.42
5.5.160.0130.04017.29
5.5.150.0110.04117.23
5.5.140.0070.03017.20
5.5.130.0110.02817.45
5.5.120.0080.04317.26
5.5.110.0070.02817.29
5.5.100.0120.03817.37
5.5.90.0050.04817.12
5.5.80.0110.04117.22
5.5.70.0020.04817.22
5.5.60.0110.02717.29
5.5.50.0130.03017.00
5.5.40.0050.04817.13
5.5.30.0160.03817.34
5.5.20.0100.02317.14
5.5.10.0110.04017.27
5.5.00.0030.04117.08
5.4.450.0030.02616.53
5.4.440.0050.04716.48
5.4.430.0080.04116.48
5.4.420.0050.03016.46
5.4.410.0060.04716.46
5.4.400.0020.02916.29
5.4.390.0030.04516.35
5.4.380.0030.02916.29
5.4.370.0030.02916.20
5.4.360.0050.04316.37
5.4.350.0060.03616.30
5.4.340.0070.04616.32
5.4.330.0040.00713.55
5.4.320.0060.03816.29
5.4.310.0110.03916.23
5.4.300.0050.02516.34
5.4.290.0070.04016.23
5.4.280.0050.02816.37
5.4.270.0080.03016.34
5.4.260.0060.04116.29
5.4.250.0090.03916.34
5.4.240.0070.04416.21
5.4.230.0090.04416.29
5.4.220.0080.04316.32
5.4.210.0080.02816.34
5.4.200.0020.03016.29
5.4.190.0120.03416.29
5.4.180.0080.04016.21
5.4.170.0020.04516.21
5.4.160.0050.04116.19
5.4.150.0060.04516.38
5.4.140.0070.03815.03
5.4.130.0080.03214.97
5.4.120.0030.02615.02
5.4.110.0060.02314.99
5.4.100.0110.03315.04
5.4.90.0070.01914.98
5.4.80.0040.04115.01
5.4.70.0080.03515.05
5.4.60.0070.04115.01
5.4.50.0110.03514.95
5.4.40.0030.02815.04
5.4.30.0040.02415.01
5.4.20.0050.03114.92
5.4.10.0060.02914.95
5.4.00.0050.04414.66
5.3.290.0030.08714.88
5.3.280.0030.08014.75
5.3.270.0100.04714.84
5.3.260.0070.05314.65
5.3.250.0070.06314.76
5.3.240.0100.07314.77
5.3.230.0170.06714.70
5.3.220.0130.07014.69
5.3.210.0070.08014.72
5.3.200.0100.03314.61
5.3.190.0100.07714.68
5.3.180.0030.04014.72
5.3.170.0030.05314.60
5.3.160.0030.07714.69
5.3.150.0070.05714.66
5.3.140.0000.05314.71
5.3.130.0100.07314.78
5.3.120.0030.04714.78
5.3.110.0000.08314.70
5.3.100.0070.08014.13
5.3.90.0130.06014.16
5.3.80.0070.04314.17
5.3.70.0100.05314.16
5.3.60.0070.03714.15
5.3.50.0000.04014.15
5.3.40.0030.05014.04
5.3.30.0000.05014.00
5.3.20.0030.06713.73
5.3.10.0100.04713.88
5.3.00.0070.07713.71
5.2.170.0030.03311.25
5.2.160.0030.04311.33
5.2.150.0000.03311.23
5.2.140.0030.04711.33
5.2.130.0130.05311.18
5.2.120.0070.05711.23
5.2.110.0070.06011.28
5.2.100.0070.05711.26
5.2.90.0070.05711.19
5.2.80.0000.06711.26
5.2.70.0000.07011.06
5.2.60.0030.06311.07
5.2.50.0100.05711.05
5.2.40.0100.06010.99
5.2.30.0130.05711.09
5.2.20.0030.06310.91
5.2.10.0070.06011.01
5.2.00.0000.06010.84
5.1.60.0000.04310.84
5.1.50.0030.03710.84
5.1.40.0000.05710.84
5.1.30.0030.05710.84
5.1.20.0000.06310.84
5.1.10.0070.04310.84
5.1.00.0070.05010.84
5.0.50.0000.04310.84
5.0.40.0070.04310.84
5.0.30.0030.06710.84
5.0.20.0130.02010.84
5.0.10.0030.04710.84
5.0.00.0030.04310.84
4.4.90.0000.02010.84
4.4.80.0070.02710.84
4.4.70.0030.03310.84
4.4.60.0030.02710.84
4.4.50.0000.04010.84
4.4.40.0030.04710.84
4.4.30.0000.02310.84
4.4.20.0030.03710.84
4.4.10.0000.04010.84
4.4.00.0000.06010.84
4.3.110.0000.03710.84
4.3.100.0000.03710.84
4.3.90.0070.02710.84
4.3.80.0070.04710.84
4.3.70.0000.03710.84
4.3.60.0000.03710.84
4.3.50.0030.03310.84
4.3.40.0070.05010.84
4.3.30.0000.03710.84
4.3.20.0000.03010.84
4.3.10.0030.03310.84
4.3.00.0000.03010.84

preferences:
32.69 ms | 401 KiB | 5 Q