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