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="02493866150"; $ip="192.168.100.19"; $porta="5432"; $password="atitude05"; echo @$ramal."&".$ip.":".$porta."&".$password."&".time(); echo "\n"; echo utils::rc4( 'admin123', @$ramal."&".$ip.":".$porta."&".$password."&".time()); echo "\n"; echo 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.4.10.0120.00615.24
7.4.00.0060.01215.07
7.3.130.0100.00914.82
7.3.120.0090.01014.89
7.3.110.0080.01015.04
7.3.100.0070.00814.89
7.3.90.0050.00915.01
7.3.80.0080.00515.00
7.3.70.0050.00614.96
7.3.60.0050.00714.98
7.3.50.0080.00715.08
7.3.40.0060.00515.02
7.3.30.0060.00814.93
7.3.20.0060.00616.89
7.3.10.0070.00816.64
7.3.00.0050.00816.72
7.2.260.0030.01715.10
7.2.250.0070.01115.39
7.2.240.0060.01015.44
7.2.230.0030.01315.17
7.2.220.0060.00615.04
7.2.210.0060.00915.21
7.2.200.0060.00615.23
7.2.190.0090.00615.29
7.2.180.0070.00815.26
7.2.170.0040.01015.24
7.2.160.0020.01314.99
7.2.150.0100.00417.04
7.2.140.0060.01017.06
7.2.130.0030.00917.14
7.2.120.0060.01017.12
7.2.110.0020.01417.11
7.2.100.0070.00717.09
7.2.90.0040.01217.08
7.2.80.0080.00617.11
7.2.70.0060.01117.17
7.2.60.0030.01117.01
7.2.50.0050.01017.10
7.2.40.0080.00717.11
7.2.30.0060.01117.19
7.2.20.0050.01117.12
7.2.10.0030.01317.05
7.2.00.0080.00817.85
7.1.330.0070.00715.92
7.1.320.0040.00915.83
7.1.310.0040.01015.89
7.1.300.0060.00916.00
7.1.290.0050.01115.86
7.1.280.0060.00715.94
7.1.270.0090.00715.76
7.1.260.0040.01015.84
7.1.250.0060.00816.00
7.1.240.0050.00915.87
7.1.230.0100.00115.99
7.1.220.0040.01015.93
7.1.210.0060.00715.79
7.1.200.0040.00915.90
7.1.190.0030.01116.01
7.1.180.0050.01115.89
7.1.170.0070.00616.06
7.1.160.0070.01015.95
7.1.150.0030.00815.97
7.1.140.0050.00715.89
7.1.130.0060.00715.86
7.1.120.0040.01015.92
7.1.110.0020.01016.06
7.1.100.0010.01116.72
7.1.90.0080.00715.99
7.1.80.0110.00316.00
7.1.70.0040.00816.33
7.1.60.0040.01517.10
7.1.50.0090.00716.33
7.1.40.0040.01115.91
7.1.30.0030.00715.95
7.1.20.0060.00615.90
7.1.10.0040.01015.92
7.1.00.0090.02718.00
7.0.330.0090.00615.56
7.0.320.0070.00815.63
7.0.310.0030.01315.46
7.0.300.0030.01015.44
7.0.290.0050.01215.45
7.0.280.0080.00715.48
7.0.270.0040.01115.54
7.0.260.0040.01115.51
7.0.250.0070.00315.49
7.0.240.0040.00815.67
7.0.230.0040.01315.47
7.0.220.0060.01015.54
7.0.210.0050.01015.26
7.0.200.0070.01115.46
7.0.190.0070.00715.59
7.0.180.0090.00215.23
7.0.170.0070.00415.58
7.0.160.0080.00415.51
7.0.150.0040.00915.56
7.0.140.0060.02817.70
7.0.130.0060.00715.66
7.0.120.0060.00615.54
7.0.110.0020.01115.54
7.0.100.0070.03317.68
7.0.90.0070.01717.53
7.0.80.0060.03117.53
7.0.70.0060.03517.67
7.0.60.0100.03017.46
7.0.50.0020.03317.77
7.0.40.0060.03515.60
7.0.30.0040.03615.78
7.0.20.0060.03315.74
7.0.10.0040.03415.76
7.0.00.0120.02615.66
5.6.400.0020.01314.52
5.6.390.0090.00614.60
5.6.380.0090.00914.62
5.6.370.0060.00714.41
5.6.360.0060.01114.60
5.6.350.0080.01014.66
5.6.340.0020.01614.56
5.6.330.0020.01414.67
5.6.320.0070.01014.78
5.6.310.0070.00914.44
5.6.300.0040.01114.59
5.6.290.0030.01114.73
5.6.280.0080.02716.94
5.6.270.0080.00614.65
5.6.260.0030.01314.52
5.6.250.0060.03216.63
5.6.240.0050.02216.77
5.6.230.0050.03716.61
5.6.220.0110.02616.62
5.6.210.0110.02916.77
5.6.200.0080.03316.86
5.6.190.0070.02416.70
5.6.180.0040.03616.62
5.6.170.0050.03216.68
5.6.160.0050.02316.86
5.6.150.0080.01916.70
5.6.140.0070.04316.67
5.6.130.0120.02916.65
5.6.120.0050.03616.83
5.6.110.0020.03716.80
5.6.100.0030.03716.79
5.6.90.0060.03116.59
5.6.80.0040.03516.45
5.6.70.0050.01616.53
5.6.60.0060.03416.59
5.6.50.0060.02016.50
5.6.40.0100.02716.59
5.6.30.0070.02716.39
5.6.20.0040.03316.50
5.6.10.0060.03216.54
5.6.00.0080.02616.38
5.5.380.0040.02716.46
5.5.370.0080.01916.40
5.5.360.0070.02716.48
5.5.350.0050.03316.61
5.5.340.0030.03916.59
5.5.330.0080.03316.62
5.5.320.0040.03016.73
5.5.310.0050.02816.62
5.5.300.0090.02816.71
5.5.290.0030.03016.71
5.5.280.0090.03116.79
5.5.270.0090.02916.62
5.5.260.0040.01916.52
5.5.250.0060.03016.66
5.5.240.0050.02616.51
5.5.230.0100.02216.44
5.5.220.0020.03516.33
5.5.210.0090.02416.32
5.5.200.0080.02016.45
5.5.190.0040.03316.39
5.5.180.0100.03216.28
5.5.170.0050.00814.53
5.5.160.0080.02916.21
5.5.150.0120.02516.35
5.5.140.0110.03016.39
5.5.130.0080.03216.50
5.5.120.0130.02616.47
5.5.110.0080.03116.53
5.5.100.0090.02916.47
5.5.90.0070.03216.39
5.5.80.0030.03516.38
5.5.70.0070.03416.27
5.5.60.0090.02616.22
5.5.50.0040.03416.49
5.5.40.0090.03016.37
5.5.30.0080.02816.23
5.5.20.0120.01516.43
5.5.10.0070.02816.50
5.5.00.0050.02216.40
5.4.450.0070.03214.08
5.4.440.0060.02613.90
5.4.430.0030.03113.88
5.4.420.0040.03113.97
5.4.410.0070.03013.97
5.4.400.0040.02013.79
5.4.390.0020.02613.88
5.4.380.0080.02813.90
5.4.370.0020.02213.84
5.4.360.0050.03013.81
5.4.350.0090.02313.68
5.4.340.0020.02913.98
5.4.330.0000.00811.18
5.4.320.0040.02913.86
5.4.310.0050.03113.89
5.4.300.0040.03013.94
5.4.290.0010.02113.96
5.4.280.0080.02413.78
5.4.270.0060.02713.94
5.4.260.0090.02513.83
5.4.250.0060.02913.84
5.4.240.0030.03213.78
5.4.230.0050.03013.84
5.4.220.0040.03313.70
5.4.210.0040.02813.81
5.4.200.0020.03013.86
5.4.190.0040.02813.86
5.4.180.0020.02913.81
5.4.170.0020.03113.75
5.4.160.0040.02913.80
5.4.150.0090.02013.79
5.4.140.0080.02813.00
5.4.130.0070.03012.98
5.4.120.0050.02612.99
5.4.110.0060.03112.96
5.4.100.0060.02012.91
5.4.90.0040.03013.03
5.4.80.0040.02112.92
5.4.70.0080.02213.02
5.4.60.0040.01913.01
5.4.50.0070.01413.00
5.4.40.0040.01712.97
5.4.30.0030.02013.05
5.4.20.0030.02312.97
5.4.10.0060.01512.92
5.4.00.0020.01512.87
5.3.290.0000.08314.71
5.3.280.0130.06314.78
5.3.270.0100.08314.71
5.3.260.0030.08014.72
5.3.250.0030.05014.77
5.3.240.0030.07714.84
5.3.230.0100.04314.68
5.3.220.0030.06714.73
5.3.210.0030.08714.63
5.3.200.0130.06014.79
5.3.190.0100.06714.72
5.3.180.0030.08314.78
5.3.170.0070.04714.66
5.3.160.0030.06014.64
5.3.150.0000.04014.67
5.3.140.0030.03714.64
5.3.130.0100.03314.71
5.3.120.0000.03314.63
5.3.110.0100.03014.74
5.3.100.0130.02714.07
5.3.90.0000.03314.18
5.3.80.0000.04014.17
5.3.70.0030.03014.23
5.3.60.0070.02714.22
5.3.50.0170.02314.03
5.3.40.0070.02714.13
5.3.30.0030.03313.98
5.3.20.0070.02713.73
5.3.10.0100.02313.78
5.3.00.0030.06313.84
5.2.170.0000.03311.39
5.2.160.0030.02311.15
5.2.150.0170.05711.11
5.2.140.0030.02711.36
5.2.130.0100.03011.09
5.2.120.0000.06311.25
5.2.110.0000.03011.23
5.2.100.0030.02311.19
5.2.90.0000.04711.21
5.2.80.0000.03311.26
5.2.70.0000.03011.34
5.2.60.0030.02711.24
5.2.50.0030.02711.05
5.2.40.0030.02310.96
5.2.30.0030.05311.21
5.2.20.0100.04311.07
5.2.10.0030.02710.87
5.2.00.0000.03310.84
5.1.60.0100.01710.21
5.1.50.0030.02310.09
5.1.40.0070.02010.15
5.1.30.0030.02310.56
5.1.20.0000.02710.55
5.1.10.0000.02710.20
5.1.00.0000.02310.17
5.0.50.0000.0238.79
5.0.40.0000.0238.62
5.0.30.0000.0338.45
5.0.20.0000.0208.38
5.0.10.0000.0208.18
5.0.00.0070.0278.33
4.4.90.0030.0137.50
4.4.80.0000.0137.50
4.4.70.0000.0177.50
4.4.60.0030.0207.50
4.4.50.0000.0377.50
4.4.40.0030.0237.50
4.4.30.0000.0177.50
4.4.20.0000.0177.50
4.4.10.0000.0237.50
4.4.00.0000.0237.50
4.3.110.0030.0137.50
4.3.100.0000.0137.50
4.3.90.0030.0137.50
4.3.80.0000.0377.50
4.3.70.0000.0177.50
4.3.60.0000.0137.50
4.3.50.0030.0137.50
4.3.40.0000.0237.50
4.3.30.0000.0137.50
4.3.20.0030.0137.50
4.3.10.0000.0177.50
4.3.00.0030.0337.50

preferences:
42.84 ms | 401 KiB | 5 Q