mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
These are no longer needed after https://wiki.php.net/rfc/always_enable_json Closes GH-5637
30 lines
493 B
PHP
30 lines
493 B
PHP
--TEST--
|
|
Allow JSON_OBJECT_AS_ARRAY to have an effect
|
|
--FILE--
|
|
<?php
|
|
|
|
$json = '{"foo":"bar"}';
|
|
|
|
var_dump(json_decode($json, false));
|
|
var_dump(json_decode($json, true));
|
|
var_dump(json_decode($json, null, 512, 0));
|
|
var_dump(json_decode($json, null, 512, JSON_OBJECT_AS_ARRAY));
|
|
?>
|
|
--EXPECTF--
|
|
object(stdClass)#%d (1) {
|
|
["foo"]=>
|
|
string(3) "bar"
|
|
}
|
|
array(1) {
|
|
["foo"]=>
|
|
string(3) "bar"
|
|
}
|
|
object(stdClass)#%d (1) {
|
|
["foo"]=>
|
|
string(3) "bar"
|
|
}
|
|
array(1) {
|
|
["foo"]=>
|
|
string(3) "bar"
|
|
}
|