3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_SERVER["HTTP_USER_AGENT"] = "TeachMe-App v000003 Android 4.4.2 on generic"; $MinVersion["TeachMe-App"] = 000004; 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");
based on 5Ff0G
Output for 5.3.0 - 7.1.0
Notice: Undefined index: Client in /in/UNo6i on line 11 Notice: Undefined index: in /in/UNo6i on line 11 Array ( [Version] => -1 ) 40000
Output for 4.3.0 - 5.2.17
Notice: Undefined index: Client in /in/UNo6i on line 11 Notice: Undefined index: in /in/UNo6i on line 11 Array ( [Version] => -1 ) 40000