summaryrefslogtreecommitdiff
path: root/ext/json/tests/bug73991.phpt
blob: d3f249d08608695bba64d5ee79321e99cd6d9587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--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"
}