3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_SERVER["HTTP_USER_AGENT"] = "TeachMe-App v000003 Android 4.4.2 on generic"; $MinVersion["TeachMe-App"] = 000004; $Client["Client"] = substr($_SERVER["HTTP_USER_AGENT"], 0, strpos($_SERVER["HTTP_USER_AGENT"], "v")-1) or die(); $Client["OS"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "v")+7, strpos($_SERVER["HTTP_USER_AGENT"], "on")-1); $Client["Device"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "on") + 3); if(!isset($_SERVER["HTTP_USER_AGENT"]) || array_search($Client["Client"], $AllowedClients) === FALSE) { header("X-API-Status: 40003 Invalid UserAgent"); die(); if(strpos($_SERVER["HTTP_USER_AGENT"], "v") > 0) { //6-Stellige Versionsnummer hinter dem v auslesen $Client["Version"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "v") + 1, 6); $Client["Version"] = is_int($Client["Version"]) ? intval($Client["Version"]) : -1; } if($Client["Version"] < $MinVersion[$Client["Client"]]) { header("X-API-Status: 40004 Client-Version Too Old"); die("40004"); } print_r($Client); die("40000");
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected end of file in /in/QU2D6 on line 26
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected $end in /in/QU2D6 on line 26
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected $ in /in/QU2D6 on line 26
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/QU2D6 on line 26
Process exited with code 255.

preferences:
229.36 ms | 1395 KiB | 123 Q