3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // 1. check if referer is Unity else echo error class Result implements \JsonSerializable { private $error; private $accessToken; public function __construct($anErrorName, $anErrorName) { $this->error = $anErrorName; $this->accessToken = $anErrorName; } public function jsonSerialize() { return get_object_vars($this); } } $result = new Result("true", 0); echo json_encode($result); $referrer = (string)$_SERVER['HTTP_USER_AGENT']; foreach( $_POST as $key=>$value) { if( is_array( $value ) ) { foreach( $value as $thing ) { echo $thing . "\xA"; } } else { echo "$key=$value" . "\xA"; } } echo'test' . "\xA";; if (strpos($referrer, 'Unity') !== false) { echo 'true'; } else echo 'false'; ?>
based on b9g9h
Output for 7.0.0 - 7.1.7
Fatal error: Redefinition of parameter $anErrorName in /in/QalAS on line 10
Process exited with code 255.
Output for 5.6.0 - 5.6.30, hhvm-3.15.4
{"error":0,"accessToken":0} Notice: Undefined index: HTTP_USER_AGENT in /in/QalAS on line 26 test false