3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json_string = <<<EOT {"name":"KillerBot 6000","desc":"A room with very harsh moderation. Proceed with caution!","max":600,"color":"#e0e0e0","whispersenabled":true,"forbiddenCommands":["/milk", "/bal"],"msg":[{"cont":"hey, hxor?","time":1,"color":"black","type":"message","visibility":"HxOr1337","from":"UnknownUser1"},{"cont":"Welcome to the chat!","time":0,"type":"message","color":"black","visibility":"HxOr1337","from":"Test"}]} EOT; $_SESSION["ts_user"] = 'HxOr1337'; //if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){ // $jsonF = file_get_contents("data/".$_GET["room"].".json"); $jsonD = json_decode($json_string, true); var_dump($jsonD); //echo count($jsonD["msg"]); // echo $jsonD["msg"][1]["type"]; foreach($jsonD["msg"] as $key => $message){ if($jsonD["msg"][$key]["visibility"] !== "all"){ if(isset($_SESSION["ts_user"]) && $_SESSION["ts_user"] == $jsonD["msg"][$key]["visibility"] && $jsonD["msg"][$key]["type"] != "rawbr"){ echo $jsonD["msg"][$key]["from"].": ".htmlspecialchars($jsonD["msg"][$key]["cont"])." [To you]", PHP_EOL; } else if($jsonD["msg"][$key]["type"] === "message"){ echo $jsonD["msg"][$key]["from"].": ".htmlspecialchars($jsonD["msg"][$key]["cont"])." [normal message]", PHP_EOL; } else if($jsonD["msg"][$key]["type"] === "rawbr"){ echo $jsonD["msg"][$key]["cont"]."<br />"; } } } //}

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.5.30.0090.01020.32
8.5.20.0050.00320.19
8.5.10.0110.00818.49
8.5.00.0100.01219.84
8.4.180.0130.00921.94
8.4.170.0120.01021.94
8.4.160.0170.00623.94
8.4.150.0070.00616.89
8.4.140.0100.01117.67
8.4.130.0100.00617.86
8.4.120.0050.00420.44
8.4.110.0100.01118.83
8.4.100.0120.00917.91
8.4.90.0120.00820.46
8.4.80.0110.00918.87
8.4.70.0070.00220.54
8.4.60.0110.00920.77
8.4.50.0130.00818.58
8.4.40.0040.00419.55
8.4.30.0080.01218.66
8.4.20.0100.01017.85
8.4.10.0030.01321.96
8.3.300.0180.00820.50
8.3.290.0160.00618.50
8.3.280.0060.00616.38
8.3.270.0140.00616.63
8.3.260.0150.00516.68
8.3.250.0140.00519.16
8.3.240.0050.00316.64
8.3.230.0110.00816.81
8.3.220.0050.00320.96
8.3.210.0120.00516.66
8.3.200.0060.00316.94
8.3.190.0060.00319.15
8.3.180.0050.00319.16
8.3.170.0070.01118.74
8.3.160.0000.00816.57
8.3.150.0100.00716.84
8.3.140.0060.00316.54
8.3.130.0000.00818.51
8.3.120.0070.00319.03
8.3.110.0030.00620.94
8.3.100.0080.00316.74
8.3.90.0070.00726.77
8.3.80.0060.00316.63
8.3.70.0140.00716.63
8.3.60.0110.00418.43
8.3.50.0070.01118.66
8.3.40.0110.00718.79
8.3.30.0030.01619.04
8.3.20.0040.00424.18
8.3.10.0090.00024.66
8.3.00.0000.00826.16
8.2.300.0070.01318.08
8.2.290.0110.00816.41
8.2.280.0110.00918.38
8.2.270.0060.00318.22
8.2.260.0080.00817.22
8.2.250.0040.00416.80
8.2.240.0100.00719.15
8.2.230.0160.00322.58
8.2.220.0000.00824.06
8.2.210.0070.00726.77
8.2.200.0090.00016.75
8.2.190.0100.01016.58
8.2.180.0100.00625.92
8.2.170.0080.00818.91
8.2.160.0030.01622.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00326.16
8.2.110.0070.00320.53
8.2.100.0000.01120.44
8.2.90.0050.00318.28
8.2.80.0000.00818.91
8.2.70.0050.00317.63
8.2.60.0030.00517.63
8.2.50.0030.00517.98
8.2.40.0050.00318.28
8.2.30.0050.00218.13
8.2.20.0040.00420.34
8.2.10.0040.00418.14
8.2.00.0050.00319.27
8.1.340.0130.01017.75
8.1.330.0130.00616.30
8.1.320.0070.00917.85
8.1.310.0060.01218.59
8.1.300.0080.01117.97
8.1.290.0090.00030.84
8.1.280.0140.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0070.00722.17
8.1.230.0070.00419.01
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0080.00017.35
8.1.190.0040.00417.25
8.1.180.0080.00018.10
8.1.170.0030.00517.62
8.1.160.0000.00820.58
8.1.150.0030.00518.72
8.1.140.0000.00717.48
8.1.130.0030.00318.91
8.1.120.0080.00017.38
8.1.110.0040.00417.38
8.1.100.0040.00417.48
8.1.90.0000.00717.32
8.1.80.0030.00617.34
8.1.70.0040.00417.39
8.1.60.0000.00917.50
8.1.50.0190.00617.54
8.1.40.0200.00317.53
8.1.30.0110.00817.58
8.1.20.0160.00817.67
8.1.10.0130.01317.59
8.1.00.0270.00017.37
8.0.300.0090.00019.77
8.0.290.0050.00316.75
8.0.280.0050.00218.34
8.0.270.0040.00417.02
8.0.260.0070.00018.44
8.0.250.0070.00017.10
8.0.240.0070.00016.97
8.0.230.0000.00717.10
8.0.220.0040.00416.88
8.0.210.0030.00316.97
8.0.200.0030.00316.95
8.0.190.0000.00717.02
8.0.180.0130.00616.99
8.0.170.0090.00916.95
8.0.160.0030.01316.84
8.0.150.0110.01016.91
8.0.140.0200.00216.82
8.0.130.0140.00916.84
8.0.120.0150.00916.93
8.0.110.0210.00316.84
8.0.100.0240.00316.87
8.0.90.0200.00016.71
8.0.80.0120.00616.66
8.0.70.0160.00316.90
8.0.60.0130.00516.37
8.0.50.0130.00416.84
8.0.30.0090.00816.70
8.0.20.0150.00416.77
8.0.10.0160.00016.80
7.4.330.0050.00015.55
7.4.320.0000.00616.62
7.4.300.0060.00016.46
7.4.290.0130.01016.06
7.4.280.0170.00016.18
7.4.270.0140.00516.27
7.4.260.0140.00716.54
7.4.250.0170.00415.96
7.4.240.0070.01016.34
7.4.230.0120.00015.88
7.4.220.0090.00616.25
7.4.210.0040.00716.20
7.4.200.0090.00316.35
7.4.190.0140.00016.13
7.4.180.0100.00516.43
7.4.160.0200.00016.18
7.4.150.0160.00316.33
7.4.140.0090.00916.18
7.4.130.0170.00415.74
7.4.120.0150.00415.95
7.4.110.0000.01416.03
7.4.100.0050.01016.23
7.4.90.0100.00616.27
7.4.80.0130.00416.02
7.4.70.0140.00315.96
7.4.60.0070.01115.89
7.4.50.0160.00416.04
7.4.40.0170.00015.87
7.4.30.0170.00015.90
7.4.20.0150.00016.01
7.4.10.0090.00216.24
7.4.00.0120.00316.19

preferences:
46.89 ms | 1454 KiB | 5 Q