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.29"; $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("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.0040.01215.03
7.3.120.0090.00915.23
7.3.110.0070.01115.28
7.3.100.0100.00714.80
7.3.90.0080.00814.77
7.3.80.0060.00615.10
7.3.70.0120.00315.03
7.3.60.0070.00714.85
7.3.50.0120.00314.80
7.3.40.0090.00615.16
7.3.30.0070.00714.90
7.3.20.0080.00416.69
7.3.10.0110.00816.59
7.3.00.0070.00716.68
7.2.250.0060.01214.94
7.2.240.0060.01615.30
7.2.230.0070.00815.46
7.2.220.0070.01115.02
7.2.210.0060.00615.30
7.2.200.0080.00815.38
7.2.190.0070.00715.35
7.2.180.0000.01315.44
7.2.170.0040.01415.29
7.2.160.0040.01215.43
7.2.150.0030.01316.97
7.2.140.0000.01516.91
7.2.130.0090.00516.97
7.2.120.0130.00616.97
7.2.110.0110.00616.65
7.2.100.0090.00916.79
7.2.90.0110.00816.75
7.2.80.0110.00716.65
7.2.70.0070.00716.98
7.2.60.0030.01316.89
7.2.50.0130.00616.89
7.2.40.0040.01316.96
7.2.30.0100.00816.87
7.2.20.0120.00617.00
7.2.10.0060.01016.98
7.2.00.0060.00817.64
7.1.330.0060.00615.80
7.1.320.0100.00715.88
7.1.310.0060.00915.80
7.1.300.0030.00615.88
7.1.290.0110.00315.73
7.1.280.0040.00416.01
7.1.270.0100.00316.01
7.1.260.0040.00715.96
7.1.250.0120.00715.81
7.1.240.0030.01015.95
7.1.230.0080.00715.67
7.1.220.0020.01115.73
7.1.210.0070.01015.83
7.1.200.0060.00915.85
7.1.190.0050.00915.76
7.1.180.0010.01015.86
7.1.170.0050.01015.79
7.1.160.0080.00615.87
7.1.150.0090.00415.65
7.1.140.0030.00815.96
7.1.130.0110.00515.85
7.1.120.0100.00815.77
7.1.110.0070.00715.76
7.1.100.0110.00716.36
7.1.90.0120.00915.95
7.1.80.0120.00915.92
7.1.70.0120.00716.18
7.1.60.0240.01016.99
7.1.50.0260.00922.31
7.1.40.0110.00615.76
7.1.30.0090.01015.89
7.1.20.0080.01415.70
7.1.10.0070.01015.79
7.1.00.0090.03017.95
7.0.330.0080.00015.60
7.0.320.0070.00715.19
7.0.310.0020.01315.46
7.0.300.0090.00615.39
7.0.290.0070.00615.46
7.0.280.0100.00415.23
7.0.270.0070.00515.48
7.0.260.0050.00715.43
7.0.250.0130.00015.33
7.0.240.0090.00615.60
7.0.230.0080.00815.71
7.0.220.0090.01015.46
7.0.210.0130.01315.36
7.0.200.0310.00415.46
7.0.190.0220.00815.59
7.0.180.0410.00515.63
7.0.170.0100.00715.67
7.0.160.0100.01015.34
7.0.150.0080.00915.39
7.0.140.0050.02517.66
7.0.130.0120.00315.43
7.0.120.0170.00015.44
7.0.110.0070.01015.39
7.0.100.0070.00915.36
7.0.90.0070.00815.44
7.0.80.0200.03116.86
7.0.70.0280.03116.94
7.0.60.0280.03116.90
7.0.50.0260.02317.07
7.0.40.0200.02915.65
7.0.30.0140.02615.65
7.0.20.0070.02315.60
7.0.10.0100.03015.64
7.0.00.0120.03115.68
5.6.400.0100.00314.60
5.6.390.0030.00614.74
5.6.380.0030.01214.58
5.6.370.0070.00814.81
5.6.360.0060.01014.34
5.6.350.0040.00914.58
5.6.340.0010.01114.49
5.6.330.0090.00614.53
5.6.320.0080.00914.47
5.6.310.0240.01314.62
5.6.300.0030.01314.52
5.6.290.0020.01314.52
5.6.280.0050.03016.81
5.6.270.0050.01014.68
5.6.260.0020.01514.64
5.6.250.0070.00814.39
5.6.240.0050.00914.43
5.6.230.0030.02516.53
5.6.220.0060.03516.54
5.6.210.0150.03316.39
5.6.200.0070.03616.54
5.6.190.0100.02416.65
5.6.180.0130.03316.65
5.6.170.0110.02616.62
5.6.160.0080.03416.69
5.6.150.0130.03216.79
5.6.140.0090.02216.77
5.6.130.0080.01916.71
5.6.120.0060.02316.83
5.6.110.0080.01916.76
5.6.100.0100.03116.74
5.6.90.0070.03516.96
5.6.80.0090.03016.41
5.6.70.0100.02016.42
5.6.60.0150.01216.38
5.6.50.0070.03316.36
5.6.40.0130.03416.52
5.6.30.0090.02216.61
5.6.20.0080.02316.45
5.6.10.0080.03116.50
5.6.00.0040.01916.63
5.5.380.0060.00812.92
5.5.370.0070.01915.29
5.5.360.0090.02115.36
5.5.350.0070.02015.38
5.5.340.0100.03215.48
5.5.330.0110.01515.51
5.5.320.0170.02215.61
5.5.310.0100.02815.44
5.5.300.0040.02015.67
5.5.290.0110.02015.69
5.5.280.0060.03515.60
5.5.270.0070.03515.55
5.5.260.0020.03615.61
5.5.250.0130.03015.47
5.5.240.0080.01715.43
5.5.230.0060.03115.36
5.5.220.0130.02315.41
5.5.210.0080.02115.24
5.5.200.0060.01915.40
5.5.190.0070.02615.41
5.5.180.0130.01515.27
5.5.170.0150.00314.26
5.5.160.0050.03415.21
5.5.150.0070.02515.28
5.5.140.0080.01815.31
5.5.130.0080.02715.35
5.5.120.0080.02915.42
5.5.110.0060.03215.26
5.5.100.0170.02615.42
5.5.90.0090.03115.15
5.5.80.0070.03115.32
5.5.70.0080.03315.18
5.5.60.0070.02615.18
5.5.50.0090.02815.22
5.5.40.0070.03115.34
5.5.30.0110.02915.40
5.5.20.0080.03115.36
5.5.10.0060.03015.36
5.5.00.0100.02715.35
5.4.450.0030.02814.36
5.4.440.0040.02314.43
5.4.430.0070.02114.37
5.4.420.0070.02614.42
5.4.410.0090.02714.27
5.4.400.0090.03014.25
5.4.390.0090.03114.20
5.4.380.0070.02914.31
5.4.370.0070.01914.28
5.4.360.0100.01714.27
5.4.350.0060.01614.17
5.4.340.0050.02914.29
5.4.330.0040.00611.78
5.4.320.0060.01614.36
5.4.310.0080.03114.12
5.4.300.0080.01414.21
5.4.290.0060.01514.28
5.4.280.0090.02214.20
5.4.270.0110.02714.33
5.4.260.0080.03114.05
5.4.250.0070.02814.29
5.4.240.0130.02514.28
5.4.230.0130.01814.05
5.4.220.0100.02814.26
5.4.210.0060.02814.31
5.4.200.0100.03114.29
5.4.190.0030.03114.22
5.4.180.0060.02914.17
5.4.170.0100.01614.24
5.4.160.0120.02114.28
5.4.150.0150.02414.25
5.4.140.0070.02113.38
5.4.130.0110.01913.31
5.4.120.0130.01413.36
5.4.110.0080.01413.41
5.4.100.0050.03013.43
5.4.90.0100.02513.37
5.4.80.0060.02313.36
5.4.70.0070.02613.44
5.4.60.0110.02713.36
5.4.50.0050.02413.41
5.4.40.0080.02713.35
5.4.30.0100.02413.31
5.4.20.0050.02213.44
5.4.10.0070.02813.37
5.4.00.0040.03113.24
5.3.290.0030.03012.94
5.3.280.0100.04012.84
5.3.270.0070.04312.86
5.3.260.0150.03312.91
5.3.250.0050.02912.88
5.3.240.0070.03012.78
5.3.230.0120.03512.75
5.3.220.0080.03812.70
5.3.210.0130.02212.80
5.3.200.0040.03912.74
5.3.190.0080.04212.73
5.3.180.0090.02212.74
5.3.170.0090.03312.85
5.3.160.0150.03512.90
5.3.150.0040.03512.88
5.3.140.0130.03512.87
5.3.130.0080.04012.67
5.3.120.0090.02712.90
5.3.110.0070.03712.63
5.3.100.0080.03512.59
5.3.90.0090.03512.38
5.3.80.0060.03012.52
5.3.70.0090.02712.47
5.3.60.0130.03712.44
5.3.50.0080.04212.51
5.3.40.0060.04012.31
5.3.30.0050.03912.47
5.3.20.0100.03312.37
5.3.10.0100.03712.27
5.3.00.0120.03912.15
5.2.170.0070.03210.58
5.2.160.0070.03010.53
5.2.150.0020.03110.49
5.2.140.0100.03210.57
5.2.130.0050.02710.48
5.2.120.0050.03210.39
5.2.110.0080.03210.36
5.2.100.0070.02510.44
5.2.90.0070.03310.50
5.2.80.0110.03010.46
5.2.70.0080.03210.38
5.2.60.0120.03010.37
5.2.50.0080.03210.31
5.2.40.0040.03410.33
5.2.30.0050.03710.34
5.2.20.0110.03210.12
5.2.10.0020.03610.20
5.2.00.0110.03210.04
5.1.60.0070.0329.42
5.1.50.0060.0259.34
5.1.40.0070.0209.48
5.1.30.0110.0279.79
5.1.20.0050.0259.74
5.1.10.0050.0329.54
5.1.00.0060.0209.45
5.0.50.0050.0148.70
5.0.40.0120.0228.58
5.0.30.0060.0338.60
5.0.20.0070.0238.54
5.0.10.0070.0228.54
5.0.00.0040.0378.54
4.4.90.0000.0217.84
4.4.80.0020.0207.84
4.4.70.0000.0217.84
4.4.60.0080.0157.84
4.4.50.0010.0177.84
4.4.40.0040.0177.84
4.4.30.0040.0197.84
4.4.20.0030.0137.84
4.4.10.0070.0107.84
4.4.00.0040.0147.84
4.3.110.0070.0157.84
4.3.100.0040.0207.84
4.3.90.0080.0207.84
4.3.80.0050.0307.84
4.3.70.0050.0187.84
4.3.60.0070.0137.84
4.3.50.0050.0177.84
4.3.40.0040.0257.84
4.3.30.0030.0167.84
4.3.20.0020.0227.84
4.3.10.0040.0137.84
4.3.00.0020.0177.84

preferences:
42.92 ms | 401 KiB | 5 Q