Annotation of embedaddon/php/ext/json/tests/json_encode_numeric.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test json_encode() function with numeric flag
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("json")) {
! 6: die('skip JSON extension not available in this build');
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: var_dump(
! 12: json_encode("1", JSON_NUMERIC_CHECK),
! 13: json_encode("9.4324", JSON_NUMERIC_CHECK),
! 14: json_encode(array("122321", "3232595.33423"), JSON_NUMERIC_CHECK),
! 15: json_encode("1"),
! 16: json_encode("9.4324"),
! 17: json_encode(array("122321", "3232595.33423"))
! 18: );
! 19: ?>
! 20: --EXPECT--
! 21: string(1) "1"
! 22: string(6) "9.4324"
! 23: string(22) "[122321,3232595.33423]"
! 24: string(3) ""1""
! 25: string(8) ""9.4324""
! 26: string(26) "["122321","3232595.33423"]"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>