3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xor_encrypt($in) { $key = '<censored>'; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } function loadData($def) { global $_COOKIE; $mydata = $def; if(array_key_exists("data", $_COOKIE)) { $tempdata = json_decode(xor_encrypt(base64_decode($_COOKIE["data"])), true); if(is_array($tempdata) && array_key_exists("showpassword", $tempdata) && array_key_exists("bgcolor", $tempdata)) { if (preg_match('/^#(?:[a-f\d]{6})$/i', $tempdata['bgcolor'])) { $mydata['showpassword'] = $tempdata['showpassword']; $mydata['bgcolor'] = $tempdata['bgcolor']; } } } return $mydata; } function saveData($d) { setcookie("data", base64_encode(xor_encrypt(json_encode($d)))); } //INput should be this: $_COOKIE["data"] //data=ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV5%2FRBFeaAw%3D function decrypt_to_string($d){ echo "\nDECRYPT $d 2 Strangggg\n"; $tempdata = json_decode(xor_encrypt(base64_decode($d)), true); echo "Var Dumping tempdata!\n"; var_dump( $tempdata ); echo "\n"; echo "BEFOREJSON\n".xor_encrypt(base64_decode($d))."\n"; } //////////////////////////////////////////////////////////////////////////////// $defaultdata = array( "showpassword"=>"no", "bgcolor"=>"#ffffff"); $data = loadData($defaultdata); if(array_key_exists("bgcolor",$_REQUEST)) { if (preg_match('/^#(?:[a-f\d]{6})$/i', $_REQUEST['bgcolor'])) { $data['bgcolor'] = $_REQUEST['bgcolor']; } } saveData($data); $kai = "ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV5%2FRBFeaAw%3D"; $kai = urldecode($kai); decrypt_to_string($kai); $defaultdataX = array( "showpassword"=>"yes", "bgcolor"=>"#ffffff"); $j_enc = json_encode($defaultdataX); $xored = xor_encrypt(json_encode($defaultdataX)); $pimping = base64_encode(xor_encrypt(json_encode($defaultdataX))); echo "\n~ ~ ~~ ~ ~~ \n"; echo $pimping; echo "\n~ ~ ~~ ~ ~~ \n"; echo $j_enc; echo "\n~ ~ ~~ ~ ~~ \n"; echo $xored; echo "\n~ ~ ~~ ~ ~~ \n"; //////////////////////////////////////////////////////////////////////////////// echo "\n\n!!!";

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.3.60.0060.01218.55
8.3.50.0070.00718.05
8.3.40.0120.00318.78
8.3.30.0090.01218.83
8.3.20.0060.01321.24
8.3.10.0040.00421.96
8.3.00.0050.00319.69
8.2.180.0040.01118.17
8.2.170.0140.00022.96
8.2.160.0070.00719.09
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0080.00020.22
8.2.120.0060.00326.35
8.2.110.0070.00322.09
8.2.100.0110.00017.72
8.2.90.0000.00819.13
8.2.80.0060.00317.97
8.2.70.0090.00017.50
8.2.60.0000.00918.16
8.2.50.0080.00018.10
8.2.40.0000.00820.45
8.2.30.0050.00319.16
8.2.20.0000.00818.18
8.2.10.0040.00418.20
8.2.00.0070.00018.25
8.1.280.0040.01125.92
8.1.270.0060.00323.92
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00923.92
8.1.230.0080.00323.90
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0000.01017.23
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0040.00418.66
8.1.160.0040.00418.91
8.1.150.0020.00520.21
8.1.140.0000.00719.64
8.1.130.0050.00318.91
8.1.120.0000.00717.41
8.1.110.0000.00817.51
8.1.100.0020.00517.48
8.1.90.0040.00417.52
8.1.80.0050.00317.37
8.1.70.0000.00717.38
8.1.60.0060.00317.57
8.1.50.0060.00317.38
8.1.40.0030.00617.43
8.1.30.0040.00417.71
8.1.20.0000.00817.63
8.1.10.0030.00717.47
8.1.00.0000.00817.39
8.0.300.0000.00818.77
8.0.290.0040.00416.58
8.0.280.0000.00718.47
8.0.270.0080.00017.29
8.0.260.0040.00418.91
8.0.250.0030.00316.89
8.0.240.0000.00716.83
8.0.230.0050.00316.98
8.0.220.0030.00316.92
8.0.210.0030.00316.79
8.0.200.0030.00317.00
8.0.190.0040.00416.84
8.0.180.0080.00016.96
8.0.170.0050.00216.91
8.0.160.0000.00716.93
8.0.150.0000.00816.88
8.0.140.0050.00216.79
8.0.130.0000.00713.34
8.0.120.0050.00316.88
8.0.110.0050.00216.90
8.0.100.0050.00216.87
8.0.90.0000.00716.95
8.0.80.0070.00716.91
8.0.70.0000.00816.70
8.0.60.0030.00516.89
8.0.50.0040.00416.83
8.0.30.0090.00717.14
8.0.20.0100.00817.41
8.0.10.0040.00416.93
8.0.00.0160.00616.77
7.4.330.0030.00315.55
7.4.320.0060.00016.69
7.4.300.0050.00216.69
7.4.290.0030.00716.54
7.4.280.0040.00416.54
7.4.270.0040.00416.60
7.4.260.0030.00316.64
7.4.250.0040.00416.55
7.4.240.0070.00016.63
7.4.230.0040.00416.55
7.4.220.0150.00316.50
7.4.210.0070.00716.58
7.4.200.0070.00016.44
7.4.160.0130.00516.54
7.4.150.0070.01117.40
7.4.140.0100.01017.86
7.4.130.0110.01516.55
7.4.120.0170.00716.56
7.4.110.0090.00916.57
7.4.100.0140.00316.31
7.4.90.0140.00416.56
7.4.80.0070.01119.39
7.4.70.0170.00316.48
7.4.60.0030.02016.63
7.4.50.0150.00016.36
7.4.40.0110.00616.70
7.4.30.0120.00616.34
7.4.00.0100.00714.95
7.3.330.0060.00013.32
7.3.320.0030.00313.39
7.3.310.0040.00416.34
7.3.300.0070.00016.27
7.3.290.0070.00916.39
7.3.280.0070.01116.41
7.3.270.0110.00617.40
7.3.260.0070.01016.44
7.3.250.0110.00916.39
7.3.240.0120.00916.43
7.3.230.0080.00816.44
7.3.210.0050.01116.31
7.3.200.0060.01216.54
7.3.190.0120.00416.58
7.3.180.0030.01416.39
7.3.170.0130.00316.52
7.3.160.0120.00916.51
7.3.120.0030.01014.84
7.3.110.0040.01514.79
7.3.100.0140.00014.81
7.3.90.0030.00614.65
7.3.80.0080.00314.90
7.3.70.0110.00314.78
7.3.60.0110.00414.88
7.3.50.0040.01114.90
7.3.40.0040.00714.89
7.3.30.0030.01314.61
7.3.20.0090.00616.68
7.3.10.0060.00916.68
7.3.00.0090.00616.72
7.2.330.0040.01416.88
7.2.320.0140.01116.83
7.2.310.0170.00016.55
7.2.300.0070.01016.58
7.2.290.0080.01116.60
7.2.250.0090.01015.15
7.2.240.0070.01414.71
7.2.230.0130.00314.78
7.2.220.0060.00914.96
7.2.210.0120.00315.21
7.2.200.0040.00715.09
7.2.190.0090.00914.95
7.2.180.0030.01315.18
7.2.170.0000.01315.15
7.2.60.0030.00616.88
7.2.00.0040.01519.31
7.1.330.0140.00315.79
7.1.320.0100.00715.78
7.1.310.0040.00415.63
7.1.300.0030.01015.68
7.1.290.0030.01015.73
7.1.280.0070.00715.97
7.1.270.0100.00615.99
7.1.260.0050.00515.86
7.1.200.0100.00715.86
7.1.100.0200.00018.16
7.1.70.0070.00316.87
7.1.60.0070.00717.19
7.1.50.0130.01334.73
7.1.40.0170.01034.40
7.1.30.0130.01334.33
7.1.20.0070.02034.40
7.1.10.0030.00716.47
7.1.00.0000.01316.50
7.0.200.0090.00916.88
7.0.190.0000.01016.42
7.0.180.0030.00716.13
7.0.170.0070.00716.17
7.0.160.0000.01016.37
7.0.150.0030.00716.20
7.0.140.0000.01016.38
7.0.130.0000.01316.55
7.0.120.0030.00716.36
7.0.110.0000.01316.16
7.0.100.0070.00716.16
7.0.90.0000.01316.19
7.0.80.0070.00716.22
7.0.70.0030.01016.25
7.0.60.0000.01015.95
7.0.50.0000.01316.19
7.0.40.0030.00716.15
7.0.30.0000.01016.29
7.0.20.0000.01016.28
7.0.10.0030.00716.32
7.0.00.0070.00716.23

preferences:
58.51 ms | 400 KiB | 5 Q