php-src/ext/json/tests/009.phpt

17 lines
317 B
PHP

--TEST--
json_encode() with non-packed array that should be encoded as an array rather than object
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$a = array(1, 2, 3, 'foo' => 'bar');
unset($a['foo']);
var_dump(json_encode($a));
echo "Done\n";
?>
--EXPECT--
string(7) "[1,2,3]"
Done