3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $R = new T(); $R->SetRequests(""); var_dump($R); class T { public $Requests = array(); public function SetRequests($Requests) { if(is_array($Requests)) { $this->Requests = $Requests; return true; } elseif(preg_match("/^(µ[^µ~]*~[01]µ)*$/i", $Requests)) { $this->Requests = array(); $Requests = explode("µµ", mb_substr($Requests, 1, -1, "UTF-8")); foreach($Requests as $Request) { $Req = explode("~", $Request); $this->Requests[] = array("Subject" => strval($Req[0]), "Active" => intval($Req[1])); } return true; } return false; } public function GetRequests() { return $this->Requests; } public function ToArray() { return array("Requests" => $this->Requests); } }
based on La0C2
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 1 in /in/0Zc3c on line 28 object(T)#1 (1) { ["Requests"]=> array(1) { [0]=> array(2) { ["Subject"]=> string(0) "" ["Active"]=> int(0) } } }
Output for hhvm-3.12.0
Notice: Undefined index: 1 in /in/0Zc3c on line 28 object(T)#1 (1) { ["Requests"]=> array(1) { [0]=> array(2) { ["Subject"]=> string(0) "" ["Active"]=> int(0) } } }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.2.17
Notice: Undefined offset: 1 in /in/0Zc3c on line 28 object(T)#1 (1) { ["Requests"]=> array(1) { [0]=> array(2) { ["Subject"]=> string(0) "" ["Active"]=> int(0) } } }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0Zc3c on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0Zc3c on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/0Zc3c on line 11
Process exited with code 255.