1--TEST--
2Test json_encode() function : error conditions
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7echo "*** Testing json_encode() : error conditions ***\n";
8
9echo "\n-- Testing json_encode() function with no arguments --\n";
10var_dump(json_encode());
11
12echo "\n-- Testing json_encode() function with more than expected no. of arguments --\n";
13$extra_arg = 10;
14var_dump(json_encode("abc", 0, $extra_arg));
15
16?>
17===Done===
18--EXPECTF--
19*** Testing json_encode() : error conditions ***
20
21-- Testing json_encode() function with no arguments --
22
23Warning: json_encode() expects at least 1 parameter, 0 given in %s on line %d
24NULL
25
26-- Testing json_encode() function with more than expected no. of arguments --
27string(5) ""abc""
28===Done===
29