1--TEST-- 2Allow JSON_OBJECT_AS_ARRAY to have an effect 3--FILE-- 4<?php 5 6$json = '{"foo":"bar"}'; 7 8var_dump(json_decode($json, false)); 9var_dump(json_decode($json, true)); 10var_dump(json_decode($json, null, 512, 0)); 11var_dump(json_decode($json, null, 512, JSON_OBJECT_AS_ARRAY)); 12--EXPECTF-- 13object(stdClass)#%d (1) { 14 ["foo"]=> 15 string(3) "bar" 16} 17array(1) { 18 ["foo"]=> 19 string(3) "bar" 20} 21object(stdClass)#%d (1) { 22 ["foo"]=> 23 string(3) "bar" 24} 25array(1) { 26 ["foo"]=> 27 string(3) "bar" 28} 29