3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Result to be returned as json class Result implements \JsonSerializable { private $error; private $accessToken; public function __construct($anErrorName, $anAccessToken) { $this->error = $anErrorName; $this->accessToken = $anAccessToken; } public function jsonSerialize() { return get_object_vars($this); } } // 1. check if referer is Unity else echo error $referrer = (string)$_SERVER['HTTP_USER_AGENT']; if (strpos($referrer, 'Unity') !== false) { // we're pl } else { $result = new Result("true", 0); echo json_encode($result); exit(); } foreach( $_POST as $key=>$value) { if( is_array( $value ) ) { foreach( $value as $thing ) { echo $thing . "\xA"; } } else { echo "$key=$value" . "\xA"; } } echo'test' . "\xA";; ?>
based on eAjbR
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
Notice: Undefined index: HTTP_USER_AGENT in /in/t77OI on line 20 {"error":"true","accessToken":0}