3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rstr() //Random String Function { $len=rand(3,6); $chr=''; for($i=1;$i<=$len;$i++) { $chr.=rand(0,1) ? chr(rand(65,90)) : chr(rand(97,122)); } return $chr; } function enjumble($data) //Custom Encoding + Base64 + gzinflate() { for($i=0;$i<strlen($data);$i++) { $data[$i]=chr(ord($data[$i])+1); } return base64_encode(gzdeflate($data,9)); } function striptag($in) //Remove < ?php from initial code { $pos = strpos($in,"<?php"); //to do: add support for short_tags if(is_numeric($pos)) { for($i=$pos;$i<=$pos+4 && strlen($in) >=5;$i++) { $in[$i]=' '; } return $in; } else { return $in; } } function makeoutfile($str) { $funcname=rstr(); $varname='$'.rstr(); $template= "<?php function ".$funcname."($varname) { $varname=gzinflate(base64_decode($varname)); for(\$i=0;\$i<strlen($varname);\$i++) { ".$varname."[\$i] = chr(ord(".$varname."[\$i])-1); } return $varname; }eval($funcname(\""; $str=enjumble($str); $template = $template . $str."\"));?>"; return $template; } function main($argc,$argv) { $banner= "\n +-------------------------------------------------------------------+ |+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| |+ +| +____ _ _ _ +| / __ \ | | | | (_) +| | / \/ __ _ _ __ | |__ _ _ | | __ _ _ __ ___ _ _ __ _+|_ | | / _` || '__|| '_ \ | | | || | / _` || '_ ` _ \ | || '_ \ / _ \ | \__/\| (_| || | | |_) || |_| || || (_| || | | | | || || | | || __/ \____/ \__,_||_| |_.__/ \__, ||_| \__,_||_| |_| |_||_||_| |_| \___| |+ __/ | +| |+ Carbylamine PHP Encoder +| |+ v0.1.1 Nightly +| |+ +| |+ +| |+ Coded by Prakhar Prasad +| |+ (prakharpd@gmail.com) +| |+ +| |+ +| |+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| +-------------------------------------------------------------------+\n\n"; $usage="$banner Syntax: ".$_SERVER['PHP_SELF']." <file to encode> <output file>\n"; if($argc==1) {echo $usage ; die();} if($argc>1) $file = $argv[1]; if($argc>2) $outfile = $argv[2]; if(empty($file) || empty($outfile)) { echo "Input/Output filename not entered!\n\n\x07" ;die();} if(!file_exists($file)) { echo "$banner Error: Input file doesn't exist\n\n\x07"; } else { $orginal_size=round(filesize($file)/1024,2); echo "$banner Encoding : $file ($orginal_size KB) \n\n "; $output_filename=$outfile; $outfile=fopen($outfile,'w+'); $file=fread(fopen($file,'r'),filesize($file)); $outdata=makeoutfile(striptag($file)); $newsize=round(strlen($outdata)/1024,2); echo " Compression : ".@round(100-(($newsize*100)/($orginal_size!=0?$orginal_size:1)),2)."%\n\n"; if(!fwrite($outfile,$outdata)) { echo " Unable to write to $output_filename\n\n\x07"; } else { echo " Successfully Encoded! to $output_filename\n\n" ; } } } main($argc,$argv); ?>

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)
8.0.120.0100.00313.42
8.0.110.0060.00613.41
8.0.100.0100.00313.39
8.0.90.0130.00013.38
8.0.80.0090.00413.39
8.0.70.0140.00013.34
8.0.60.0000.01313.37
8.0.50.0060.00613.36
8.0.30.0120.00013.37
8.0.20.0080.00413.55
8.0.10.0000.00913.57
8.0.00.0090.00013.43
7.4.250.0080.00813.35
7.4.240.0110.00313.40
7.4.230.0030.00313.32
7.4.220.0000.00713.27
7.4.210.0030.00313.34
7.4.200.0060.00013.37
7.4.190.0030.00313.36
7.4.180.0000.00513.39
7.4.160.0000.00513.37
7.4.150.0060.00013.30
7.4.140.0030.00313.33
7.4.130.0060.00013.34
7.4.120.0100.00013.18
7.4.110.0000.00813.27
7.4.100.0060.00313.24
7.4.90.0080.00413.18
7.4.80.0060.00313.26
7.4.70.0080.00013.25
7.4.60.0070.00313.33
7.4.50.0030.00513.05
7.4.40.0030.00713.14
7.4.30.0040.00413.10
7.4.20.0100.00013.16
7.4.10.0050.00413.25
7.4.00.0070.00614.22
7.3.310.0060.00313.26
7.3.300.0090.00013.33
7.3.290.0050.00513.46
7.3.280.0040.00813.47
7.3.270.0090.00313.34
7.3.260.0060.00613.29
7.3.250.0100.00213.48
7.3.240.0100.00313.43
7.3.230.0080.00413.43
7.3.220.0100.00313.38
7.3.210.0060.00613.31
7.3.200.0040.00913.23
7.3.190.0040.00813.39
7.3.180.0100.00313.43
7.3.170.0100.00513.33
7.3.160.0130.00313.41
7.3.150.0090.00513.49
7.3.140.0140.00013.40
7.3.130.0110.00413.34
7.3.120.0130.00314.11
7.3.110.0110.00514.12
7.3.100.0040.01014.17
7.3.90.0100.00414.35
7.3.80.0050.00814.12
7.3.70.0080.00614.08
7.3.60.0070.00714.12
7.3.50.0090.00314.08
7.3.40.0060.00614.06
7.3.30.0060.00814.32
7.3.20.0080.00615.93
7.3.10.0000.01415.88
7.3.00.0120.00215.86
7.2.340.0120.00013.49
7.2.330.0090.00413.43
7.2.320.0120.00013.45
7.2.310.0060.00613.43
7.2.300.0120.00013.35
7.2.290.0090.00413.37
7.2.280.0100.00313.28
7.2.270.0080.00413.43
7.2.260.0100.00313.28
7.2.250.0110.00514.21
7.2.240.0110.00314.23
7.2.230.0040.00814.24
7.2.220.0080.00514.24
7.2.210.0060.00514.23
7.2.200.0060.00814.22
7.2.190.0060.00514.39
7.2.180.0050.00914.36
7.2.170.0070.00714.31
7.2.160.0110.00213.56
7.2.150.0030.01015.34
7.2.140.0130.00015.17
7.2.130.0100.00315.46
7.2.120.0100.00315.39
7.2.110.0090.00515.45
7.2.100.0080.00515.38
7.2.90.0110.00415.29
7.2.80.0080.00515.31
7.2.70.0080.00515.19
7.2.60.0090.00415.35
7.2.50.0130.00015.18
7.2.40.0080.00515.20
7.2.30.0100.00415.37
7.2.20.0040.00915.44
7.2.10.0080.00515.39
7.2.00.0070.00717.47
7.1.330.0100.00415.11
7.1.320.0080.00515.02
7.1.310.0090.00415.11
7.1.300.0080.00515.16
7.1.290.0080.00714.99
7.1.280.0040.00815.04
7.1.270.0080.00515.08
7.1.260.0060.00614.98
7.1.250.0090.00414.34
7.1.240.0080.00414.27
7.1.230.0080.00414.33
7.1.220.0090.00314.25
7.1.210.0100.00214.38
7.1.200.0130.00014.16
7.1.190.0090.00314.38
7.1.180.0040.00814.14
7.1.170.0090.00214.10
7.1.160.0080.00414.14
7.1.150.0080.00414.09
7.1.140.0080.00514.18
7.1.130.0100.00314.34
7.1.120.0120.00014.31
7.1.110.0100.00214.21
7.1.100.0090.00214.23
7.1.90.0080.00414.44
7.1.80.0090.00314.20
7.1.70.0060.00415.68
7.1.60.0080.00816.89
7.1.50.0090.00815.74
7.1.40.0130.00014.34
7.1.30.0100.00214.52
7.1.20.0080.00514.31
7.1.10.0060.00614.18
7.1.00.0080.03718.23
7.0.330.0120.00014.06
7.0.320.0120.00014.22
7.0.310.0060.00614.28
7.0.300.0080.00414.04
7.0.290.0080.00414.27
7.0.280.0090.00314.21
7.0.270.0080.00314.23
7.0.260.0040.00714.25
7.0.250.0090.00314.33
7.0.240.0080.00414.33
7.0.230.0060.00614.15
7.0.220.0030.00914.27
7.0.210.0080.00414.25
7.0.200.0050.00515.36
7.0.190.0100.00214.30
7.0.180.0060.00614.28
7.0.170.0090.00214.43
7.0.160.0090.00314.21
7.0.150.0090.00314.08
7.0.140.0080.03718.01
7.0.130.0060.00614.25
7.0.120.0080.03518.27
7.0.110.0060.00614.19
7.0.100.0060.00614.25
7.0.90.0120.00014.21
7.0.80.0130.00014.15
7.0.70.0060.00614.21
7.0.60.0090.02617.13
7.0.50.0060.02215.96
7.0.40.0080.04417.18
7.0.30.0130.02617.23
7.0.20.0220.03417.22
7.0.10.0040.04917.24
7.0.00.0080.04317.26
5.6.400.0080.00412.87
5.6.390.0100.00212.80
5.6.380.0000.01212.80
5.6.370.0050.00612.73
5.6.360.0120.00012.75
5.6.350.0120.00012.94
5.6.340.0040.00812.73
5.6.330.0000.01212.77
5.6.320.0060.00612.79
5.6.310.0110.00012.60
5.6.300.0100.00212.46
5.6.290.0080.00412.80
5.6.280.0050.04116.86
5.6.270.0090.00312.59
5.6.260.0070.00412.80
5.6.250.0090.00212.78
5.6.240.0120.00012.70
5.6.230.0060.00613.07
5.6.220.0120.00012.70
5.6.210.0090.02716.83
5.6.200.0090.04115.63
5.6.190.0050.02716.76
5.6.180.0140.03316.72
5.6.170.0170.02416.75
5.6.160.0100.03816.65
5.6.150.0060.02315.55
5.6.140.0080.01915.63
5.6.130.0060.04515.61
5.6.120.0110.03916.94
5.6.110.0160.03816.77
5.6.100.0130.03816.84
5.6.90.0030.03816.77
5.6.80.0080.03916.51
5.6.70.0110.00012.94
5.6.60.0050.00513.12
5.6.50.0090.00212.75
5.6.40.0050.00513.00
5.6.30.0090.00312.99
5.6.20.0110.00012.89
5.6.10.0040.00712.77
5.6.00.0110.00012.83
5.5.380.0080.00412.98
5.5.370.0060.00612.98
5.5.360.0120.00012.77
5.5.350.1330.02116.57
5.5.340.0080.02015.44
5.5.330.0040.04516.53
5.5.320.0160.04216.42
5.5.310.0200.02716.55
5.5.300.0150.02215.34
5.5.290.0060.02715.45
5.5.280.0050.04016.80
5.5.270.0040.02416.70
5.5.260.0120.02216.79
5.5.250.0110.04016.78
5.5.240.0030.02316.69
5.5.230.0110.00012.86
5.5.220.0090.00312.84
5.5.210.0070.00412.91
5.5.200.0120.00012.62
5.5.190.0050.00612.40
5.5.180.0000.01212.71
5.5.170.0110.00012.60
5.5.160.0050.00512.47
5.5.150.0060.00612.73
5.5.140.0080.00412.27
5.5.130.0100.00212.49
5.5.120.0090.00212.32
5.5.110.0080.00412.60
5.5.100.0090.00312.54
5.5.90.0060.00612.81
5.5.80.0000.01112.59
5.5.70.0070.00412.97
5.5.60.0080.00312.61
5.5.50.0050.00512.90
5.5.40.0040.00712.98
5.5.30.0070.00412.80
5.5.20.0080.00312.80
5.5.10.0070.00312.78
5.5.00.0110.00012.91
5.4.450.0100.02816.12
5.4.440.0140.01816.12
5.4.430.0120.02016.19
5.4.420.0110.02316.11
5.4.410.0150.01815.93
5.4.400.0100.02316.05
5.4.390.0150.01715.94
5.4.380.0110.02015.88
5.4.370.0100.02416.04
5.4.360.0150.02016.03
5.4.350.0130.01916.01
5.4.340.0110.02516.05
5.4.330.0110.00012.84
5.4.320.0140.01815.92
5.4.310.0120.02015.85
5.4.300.0070.02515.92
5.4.290.0120.02215.92
5.4.280.0190.01315.88
5.4.270.0170.01715.88
5.4.260.0150.02215.86
5.4.250.0120.02315.92
5.4.240.0080.02215.98
5.4.230.0140.03115.74
5.4.220.0120.02015.63
5.4.210.0130.02215.81
5.4.200.0150.03515.84
5.4.190.0100.02515.89
5.4.180.0120.02015.79
5.4.170.0140.01915.69
5.4.160.0190.03315.97
5.4.150.0190.02715.89
5.4.140.0160.03514.61
5.4.130.0100.02114.53
5.4.120.0160.01814.67
5.4.110.0130.03714.53
5.4.100.0170.02014.57
5.4.90.0140.01814.49
5.4.80.0130.02614.59
5.4.70.0140.03414.56
5.4.60.0180.03514.50
5.4.50.0160.02314.55
5.4.40.0140.02914.53
5.4.30.0140.03114.49
5.4.20.0110.04214.54
5.4.10.0180.02414.66
5.4.00.0140.02614.31
5.3.290.0150.02313.86
5.3.280.0200.02013.82
5.3.270.0170.03913.83
5.3.260.0150.03913.99
5.3.250.0150.02113.79
5.3.240.0200.01513.80
5.3.230.0160.03413.80
5.3.220.0160.03813.78
5.3.210.0210.02213.65
5.3.200.0160.02113.79
5.3.190.0150.02013.76
5.3.180.0150.03813.88
5.3.170.0140.02814.00
5.3.160.0150.03614.01
5.3.150.0140.02213.84
5.3.140.0150.03213.82
5.3.130.0110.02113.79
5.3.120.0140.03213.80
5.3.110.0080.02913.74
5.3.100.0130.02213.56
5.3.90.0110.03813.65
5.3.80.0150.03013.55
5.3.70.0140.01913.61
5.3.60.0170.03213.44
5.3.50.0150.02013.42
5.3.40.0150.02113.47
5.3.30.0190.02213.48
5.3.20.0100.02613.43
5.3.10.0110.03813.31
5.3.00.0160.02813.26
5.2.170.0150.02912.21
5.2.160.0090.02512.18
5.2.150.0070.01912.26
5.2.140.0130.03312.22
5.2.130.0100.02512.23
5.2.120.0080.02312.15
5.2.110.0080.01912.15
5.2.100.0080.03612.12
5.2.90.0140.02912.22
5.2.80.0130.03012.08
5.2.70.0120.01612.09
5.2.60.0110.02312.13
5.2.50.0090.03612.19
5.2.40.0110.03112.09
5.2.30.0090.02712.17
5.2.20.0180.01512.02
5.2.10.0100.02512.14
5.2.00.0160.02511.97
5.1.60.0110.01311.66
5.1.50.0080.01411.75
5.1.40.0100.02411.70
5.1.30.0180.02011.90
5.1.20.0050.02411.74
5.1.10.0070.01911.70
5.1.00.0100.02911.73
5.0.50.0080.02511.39
5.0.40.0090.01811.39
5.0.30.0080.01511.39
5.0.20.0080.01811.39
5.0.10.0080.01711.39
5.0.00.0060.01511.39
4.4.90.0070.00711.39
4.4.80.0080.01611.39
4.4.70.0050.01511.39
4.4.60.0070.01711.40
4.4.50.0030.01711.40
4.4.40.0090.02511.41
4.4.30.0070.01511.41
4.4.20.0100.01411.41
4.4.10.0050.01711.41
4.4.00.0050.02511.42
4.3.110.0080.01711.42
4.3.100.0080.01511.43
4.3.90.0060.01011.44
4.3.80.0060.01311.44
4.3.70.0070.01511.45
4.3.60.0090.01511.45
4.3.50.0080.01611.45
4.3.40.0090.01711.46
4.3.30.0020.01011.47
4.3.20.0030.02011.47
4.3.10.0050.00711.48
4.3.00.0020.01811.48

preferences:
52.83 ms | 401 KiB | 5 Q