summaryrefslogtreecommitdiff
path: root/ext/json/tests/bug73991.phpt
blob: fc0be19a92969c108edeeb21658589dc573a3f21 (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
30
31
--TEST--
Allow JSON_OBJECT_AS_ARRAY to have an effect
--SKIPIF--
<?php if(!extension_loaded('json')) die('skip json extension not loaded') ?>
--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"
}