Bart de Boer wrote:
Maybe introduce an optional second argument "decodetype" to
json_decode() where you could pass on a constant like JSON_ARRAY or
JSON_OBJECT?
For example:
$assoc_array = json_decode($json_string, JSON_ARRAY);
$object = json_decode($json_string, JSON_OBJECT);
I'm not saying this is a bad idea but is it really necessary? It seems to
just add extra complexity. If json_decode() returns an associative array then
you can cast easily enough:
$obj = (object)json_decode($jsonSerialized);
Mike
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php