Is it possible for there to by any type of value in $_GET
or $_POST
which is not an array or string?
For those who read code better, is it at all possible to run this simple script on a web server and get it to throw the exception?
// crash-me.php
<?php
function must_be_array_or_string($value) {
if(is_string($value))
return;
if(is_array($value)) {
foreach($value as $subValue)
must_be_array_or_string($subValue);
return;
}
throw new Exception("Value is " . gettype($value));
}
if(isset($_GET))
must_be_array_or_string($_GET);
if(isset($_POST))
must_be_array_or_string($_POST);