3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function postLikeStrToArray($str) { $_p = explode('&amp;', $str); $post = []; foreach ($_p as $item) { $parts = explode('=', $item); $key = strtolower($parts[0]); $value = urldecode($parts[1]); $post[$key] = $value; } return $post; } $resp = urldecode("MerID=I0110DQX&amp;OrderID=191&amp;ResponseCode=3&amp;ReasonCode=11&amp;ReasonCodeDesc=Invalid+signature&amp;Signature=hHxm7Zd1GeUJz3ZfkloaNG%2BC1hk%3D"); $post = postLikeStrToArray($resp); print_r($post);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [merid] => I0110DQX [orderid] => 191 [responsecode] => 3 [reasoncode] => 11 [reasoncodedesc] => Invalid signature [signature] => hHxm7Zd1GeUJz3ZfkloaNG C1hk )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/O0dU7 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/O0dU7 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/O0dU7 on line 5
Process exited with code 255.