var_dump(json_encode(1));
var_dump(json_encode("руссиш"));
-
echo "Done\n";
?>
--EXPECTF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-
-$a = array('<foo>',"'bar'",'"baz"','&blong&');
+$a = array('<foo>', "'bar'", '"baz"', '&blong&');
echo "Normal: ", json_encode($a), "\n";
-echo "Tags: ", json_encode($a,JSON_HEX_TAG), "\n";
-echo "Apos: ", json_encode($a,JSON_HEX_APOS), "\n";
-echo "Quot: ", json_encode($a,JSON_HEX_QUOT), "\n";
-echo "Amp: ", json_encode($a,JSON_HEX_AMP), "\n";
-echo "All: ", json_encode($a,JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP), "\n";
+echo "Tags: ", json_encode($a, JSON_HEX_TAG), "\n";
+echo "Apos: ", json_encode($a, JSON_HEX_APOS), "\n";
+echo "Quot: ", json_encode($a, JSON_HEX_QUOT), "\n";
+echo "Amp: ", json_encode($a, JSON_HEX_AMP), "\n";
+echo "All: ", json_encode($a, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP), "\n";
?>
--EXPECT--
Normal: ["<foo>","'bar'","\"baz\"","&blong&"]
var_dump(json_decode("[1"));
var_dump(json_last_error(), json_last_error_msg());
-
echo "Done\n";
?>
--EXPECT--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-function show_eq($x,$y) {
- echo "$x ". ($x==$y ? "==" : "!=") ." $y\n";
+function json_test_show_eq($x, $y) {
+ echo "$x ". ( $x == $y ? "==" : "!=") ." $y\n";
}
$value = 0x7FFFFFFF; #2147483647;
-show_eq("$value", json_encode($value));
+json_test_show_eq("$value", json_encode($value));
$value++;
-show_eq("$value", json_encode($value));
+json_test_show_eq("$value", json_encode($value));
?>
--EXPECT--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-echo json_encode(array(0,"\0ab"=>1,"\0null-prefixed value"));
+echo json_encode(array(0, "\0ab"=>1, "\0null-prefixed value"));
echo "\nDone\n";
?>
--EXPECT--
Bug #41403 (json_decode cannot decode floats if localeconv decimal_point is not '.')
--SKIPIF--
<?php
-
if (!extension_loaded('json')) die('skip');
-
if (setlocale(LC_NUMERIC, "de_DE") === false) {
die("skip no de_DE locale");
}
Bug #42785 (Incorrect formatting of double values with non-english locales)
--SKIPIF--
<?php
- if (!extension_loaded("json")) {
- print "skip";
- } else if (!setlocale(LC_CTYPE, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1")) {
- die("skip locale needed for this test is not supported on this platform");
- }
+if (!extension_loaded('json')) die('skip');
+if (!setlocale(LC_CTYPE, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1")) {
+ die("skip locale needed for this test is not supported on this platform");
+}
?>
--FILE--
<?php
setlocale(LC_ALL, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1");
-$foo = Array(100.10,"bar");
+$foo = array(100.10,"bar");
var_dump(json_encode($foo));
-Class bar {}
+class bar {}
$bar1 = new bar;
$bar1->a = 100.10;
$bar1->b = "foo";
--TEST--
Bug #46215 (json_encode mutates its parameter and has some class-specific state)
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
class foo {
- protected $a = array();
+ protected $a = array();
}
$a = new foo;
<?php
for ($i = 1; $i <= 16; $i++) {
- $first = 0xf0|($i >> 2);
- $second = 0x8f|($i & 3) << 4;
+ $first = 0xf0 | ($i >> 2);
+ $second = 0x8f | ($i & 3) << 4;
$string = sprintf("aa%c%c\xbf\xbdzz", $first, $second);
echo json_encode($string) . "\n";
}
Bug #47644 (valid large integers are truncated)
--SKIPIF--
<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
- if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+if (!extension_loaded('json')) die('skip');
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
var_dump(json_last_error(), json_last_error_msg());
$c = array(
- 'foo' => $bad_utf8,
- 'bar' => 1
+ 'foo' => $bad_utf8,
+ 'bar' => 1
);
json_encode($c);
var_dump(json_last_error(), json_last_error_msg());
json_decode("");
var_dump(json_last_error());
-
json_decode("invalid json");
var_dump(json_last_error());
-
json_decode("");
var_dump(json_last_error());
?>
<?php
class JsonTest1 {
- public $test;
- public $me;
- public function __construct() {
- $this->test = '123';
- $this->me = $this;
- }
+ public $test;
+ public $me;
+ public function __construct() {
+ $this->test = '123';
+ $this->me = $this;
+ }
}
class JsonTest2 implements JsonSerializable {
- public $test;
- public function __construct() {
- $this->test = '123';
- }
- public function jsonSerialize() {
- return array(
- 'test' => $this->test,
- 'me' => $this
- );
- }
+ public $test;
+ public function __construct() {
+ $this->test = '123';
+ }
+ public function jsonSerialize() {
+ return array(
+ 'test' => $this->test,
+ 'me' => $this
+ );
+ }
}
<?php
$array = array();
-for ($i=0; $i<550; $i++) {
- $array = array($array);
+for ($i=0; $i < 550; $i++) {
+ $array = array($array);
}
json_encode($array, 0, 551);
switch (json_last_error()) {
- case JSON_ERROR_NONE:
- echo 'OK'.PHP_EOL;
- break;
- case JSON_ERROR_DEPTH:
- echo 'ERROR'.PHP_EOL;
- break;
+ case JSON_ERROR_NONE:
+ echo 'OK' . PHP_EOL;
+ break;
+ case JSON_ERROR_DEPTH:
+ echo 'ERROR' . PHP_EOL;
+ break;
}
json_encode($array, 0, 540);
switch (json_last_error()) {
- case JSON_ERROR_NONE:
- echo 'OK'.PHP_EOL;
- break;
- case JSON_ERROR_DEPTH:
- echo 'ERROR'.PHP_EOL;
- break;
+ case JSON_ERROR_NONE:
+ echo 'OK' . PHP_EOL;
+ break;
+ case JSON_ERROR_DEPTH:
+ echo 'ERROR' . PHP_EOL;
+ break;
}
--EXPECTF--
OK
--FILE--
<?php
function decode($json) {
- $x = json_decode($json);
- var_dump($x);
- $x = json_decode($json, false, 512, JSON_BIGINT_AS_STRING);
- var_dump($x);
+ $x = json_decode($json);
+ var_dump($x);
+ $x = json_decode($json, false, 512, JSON_BIGINT_AS_STRING);
+ var_dump($x);
}
decode('123456789012345678901234567890');
--FILE--
<?php
function decode($json) {
- var_dump(json_decode($json));
- var_dump(json_last_error() !== 0);
- echo "\n";
+ var_dump(json_decode($json));
+ var_dump(json_last_error() !== 0);
+ echo "\n";
}
// Leading whitespace should be ignored
--FILE--
<?php
function decode($json) {
- var_dump(json_decode($json));
- echo ((json_last_error() !== 0) ? 'ERROR' : 'SUCCESS') . PHP_EOL;
+ var_dump(json_decode($json));
+ echo ((json_last_error() !== 0) ? 'ERROR' : 'SUCCESS') . PHP_EOL;
}
// Only lowercase should work
private $bar = 'baz';
}
-echo json_encode([[], (object)[], new Foo], JSON_PRETTY_PRINT), "\n";
+echo json_encode(array(array(), (object) array(), new Foo), JSON_PRETTY_PRINT);
?>
--EXPECT--
JSON (http://www.crockford.com/JSON/JSON_checker/test/fail*.json)
--SKIPIF--
<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
+ if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php
-$tests = array('"A JSON payload should be an object or array, not a string."',
- '["Unclosed array"',
- '{unquoted_key: "keys must be quoted}',
- '["extra comma",]',
- '["double extra comma",,]',
- '[ , "<-- missing value"]',
- '["Comma after the close"],',
- '["Extra close"]]',
- '{"Extra comma": true,}',
- '{"Extra value after close": true} "misplaced quoted value"',
- '{"Illegal expression": 1 + 2}',
- '{"Illegal invocation": alert()}',
- '{"Numbers cannot have leading zeroes": 013}',
- '{"Numbers cannot be hex": 0x14}',
- '["Illegal backslash escape: \\x15"]',
- '["Illegal backslash escape: \\\'"]',
- '["Illegal backslash escape: \\017"]',
- '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]',
- '{"Missing colon" null}',
- '{"Double colon":: null}',
- '{"Comma instead of colon", null}',
- '["Colon instead of comma": false]',
- '["Bad value", truth]',
- "['single quote']");
+$tests = array(
+ '"A JSON payload should be an object or array, not a string."',
+ '["Unclosed array"',
+ '{unquoted_key: "keys must be quoted}',
+ '["extra comma",]',
+ '["double extra comma",,]',
+ '[ , "<-- missing value"]',
+ '["Comma after the close"],',
+ '["Extra close"]]',
+ '{"Extra comma": true,}',
+ '{"Extra value after close": true} "misplaced quoted value"',
+ '{"Illegal expression": 1 + 2}',
+ '{"Illegal invocation": alert()}',
+ '{"Numbers cannot have leading zeroes": 013}',
+ '{"Numbers cannot be hex": 0x14}',
+ '["Illegal backslash escape: \\x15"]',
+ '["Illegal backslash escape: \\\'"]',
+ '["Illegal backslash escape: \\017"]',
+ '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]',
+ '{"Missing colon" null}',
+ '{"Double colon":: null}',
+ '{"Comma instead of colon", null}',
+ '["Colon instead of comma": false]',
+ '["Bad value", truth]',
+ "['single quote']"
+);
-foreach ($tests as $test)
-{
- echo 'Testing: ' . $test . "\n";
- echo "AS OBJECT\n";
- var_dump(json_decode($test));
- echo "AS ARRAY\n";
- var_dump(json_decode($test, true));
+foreach ($tests as $test) {
+ echo 'Testing: ' . $test . "\n";
+ echo "AS OBJECT\n";
+ var_dump(json_decode($test));
+ echo "AS ARRAY\n";
+ var_dump(json_decode($test, true));
}
?>
--TEST--
Test json_decode() function : basic functionality
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : mixed json_decode ( string $json [, bool $assoc ] )
- * Description: Decodes a JSON string
- * Source code: ext/json/php_json.c
- * Alias to functions:
- */
echo "*** Testing json_decode() : basic functionality ***\n";
// array with different values for $string
$inputs = array (
- '0',
- '123',
- '-123',
- '2147483647',
- '-2147483648',
- '123.456',
- '1230',
- '-1230',
- 'true',
- 'false',
- 'null',
- '"abc"',
- '"Hello World\r\n"',
- '[]',
- '[1,2,3,4,5]',
- '{"myInt":99,"myFloat":123.45,"myNull":null,"myBool":true,"myString":"Hello World"}',
- '{"Jan":31,"Feb":29,"Mar":31,"April":30,"May":31,"June":30}',
- '""',
- '{}'
+ '0',
+ '123',
+ '-123',
+ '2147483647',
+ '-2147483648',
+ '123.456',
+ '1230',
+ '-1230',
+ 'true',
+ 'false',
+ 'null',
+ '"abc"',
+ '"Hello World\r\n"',
+ '[]',
+ '[1,2,3,4,5]',
+ '{"myInt":99,"myFloat":123.45,"myNull":null,"myBool":true,"myString":"Hello World"}',
+ '{"Jan":31,"Feb":29,"Mar":31,"April":30,"May":31,"June":30}',
+ '""',
+ '{}'
);
// loop through with each element of the $inputs array to test json_decode() function
$count = 1;
foreach($inputs as $input) {
- echo "-- Iteration $count --\n";
- var_dump(json_decode($input));
- var_dump(json_decode($input, TRUE));
- $count ++;
+ echo "-- Iteration $count --\n";
+ var_dump(json_decode($input));
+ var_dump(json_decode($input, true));
+ $count++;
}
?>
--TEST--
Test json_decode() function : error conditions
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : mixed json_decode ( string $json [, bool $assoc=false [, int $depth=512 ]] )
- * Description: Decodes a JSON string
- * Source code: ext/json/php_json.c
- * Alias to functions:
- */
echo "*** Testing json_decode() : error conditions ***\n";
echo "\n-- Testing json_decode() function with no arguments --\n";
-var_dump( json_decode() );
+var_dump(json_decode());
echo "\n-- Testing json_decode() function with more than expected no. of arguments --\n";
$extra_arg = 10;
-var_dump( json_decode('"abc"', TRUE, 512, 0, $extra_arg) );
+var_dump(json_decode('"abc"', true, 512, 0, $extra_arg));
?>
===Done===
--TEST--
Test json_encode() function : basic functionality
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : string json_encode ( mixed $value )
- * Description: Returns the JSON representation of a value
- * Source code: ext/json/php_json.c
- * Alias to functions:
- */
echo "*** Testing json_encode() : basic functionality ***\n";
//get an unset variable
// array with different values for $string
$inputs = array (
+ // integers
+ 0,
+ 123,
+ -123,
+ 2147483647,
+ -2147483648,
- // integers
-/*1*/ 0,
- 123,
- -123,
- 2147483647,
- -2147483648,
+ // floats
+ 123.456,
+ 1.23E3,
+ -1.23E3,
- // floats
-/*6*/ 123.456,
- 1.23E3,
- -1.23E3,
-
- // boolean
-/*9*/ TRUE,
- true,
- FALSE,
- false,
+ // boolean
+ TRUE,
+ true,
+ FALSE,
+ false,
- // NULL
-/*13*/ NULL,
- null,
-
- // strings
-/*15*/ "abc",
- 'abc',
- "Hello\t\tWorld\n",
+ // NULL
+ NULL,
+ null,
- // arrays
-/*18*/ array(),
- array(1,2,3,4,5),
- array(1 => "Sun", 2=>"Mon", 3 => "Tue", 4 => "Wed", 5 => "Thur", 6 => "Fri", 7 => "Sat"),
- array("Jan" => 31, "Feb" => 29, "Mar" => 31, "April" => 30, "May" => 31, "June" => 30),
-
- // empty data
-/*22*/ "",
- '',
+ // strings
+ "abc",
+ 'abc',
+ "Hello\t\tWorld\n",
+
+ // arrays
+ array(),
+ array(1,2,3,4,5),
+ array(1 => "Sun", 2 => "Mon", 3 => "Tue", 4 => "Wed", 5 => "Thur", 6 => "Fri", 7 => "Sat"),
+ array("Jan" => 31, "Feb" => 29, "Mar" => 31, "April" => 30, "May" => 31, "June" => 30),
+
+ // empty data
+ "",
+ '',
- // undefined data
-/*24*/ @$undefined_var,
+ // undefined data
+ @$undefined_var,
- // unset data
-/*25*/ @$unset_var,
+ // unset data
+ @$unset_var,
- // resource variable
-/*26*/ $fp,
+ // resource variable
+ $fp,
- // object variable
-/*27*/ $obj
+ // object variable
+ $obj
);
// loop through with each element of the $inputs array to test json_encode() function
$count = 1;
foreach($inputs as $input) {
- echo "-- Iteration $count --\n";
- var_dump(json_encode($input));
- $count ++;
+ echo "-- Iteration $count --\n";
+ var_dump(json_encode($input));
+ $count ++;
}
?>
--TEST--
Test json_encode() function : basic functionality with UTF8 string input
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : string json_encode ( mixed $value )
- * Description: Returns the JSON representation of a value
- * Source code: ext/json/php_json.c
- * Alias to functions:
- */
echo "*** Testing json_encode() : basic functionality with UTF-8 input***\n";
$utf8_string = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
--TEST--
Test json_encode() function : error conditions
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : string json_encode ( mixed $value [, int $options=0 ] )
- * Description: Returns the JSON representation of a value
- * Source code: ext/json/php_json.c
- * Alias to functions:
- */
-
echo "*** Testing json_encode() : error conditions ***\n";
echo "\n-- Testing json_encode() function with no arguments --\n";
-var_dump( json_encode() );
+var_dump(json_encode());
echo "\n-- Testing json_encode() function with more than expected no. of arguments --\n";
$extra_arg = 10;
-var_dump( json_encode("abc", 0, $extra_arg) );
+var_dump(json_encode("abc", 0, $extra_arg));
?>
===Done===
--TEST--
Test json_encode() function with numeric flag
--SKIPIF--
-<?php
-if (!extension_loaded("json")) {
- die('skip JSON extension not available in this build');
-}
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(
--TEST--
json_last_error() failures
--SKIPIF--
-<?php !extension_loaded('json') && die('skip json extension not available') ?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_last_error());
-var_dump(json_last_error(TRUE));
+var_dump(json_last_error(true));
var_dump(json_last_error('some', 4, 'args', 'here'));
-
?>
--EXPECTF--
int(0)
--TEST--
json_last_error_msg() failures
--SKIPIF--
-<?php !extension_loaded('json') && die('skip json extension not available') ?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_last_error_msg());
-var_dump(json_last_error_msg(TRUE));
+var_dump(json_last_error_msg(true));
var_dump(json_last_error_msg('some', 4, 'args', 'here'));
?>
precision=14
--SKIPIF--
<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
- if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+if (!extension_loaded('json')) die('skip');
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
?>
--FILE--
<?php
precision=14
--SKIPIF--
<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
- if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+if (!extension_loaded('json')) die('skip');
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
precision=14
--SKIPIF--
<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
+if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php
--TEST--
JSON (http://www.crockford.com/JSON/JSON_checker/test/pass2.json)
--SKIPIF--
-<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
--TEST--
JSON (http://www.crockford.com/JSON/JSON_checker/test/pass3.json)
--SKIPIF--
-<?php
- if (!extension_loaded('json')) die('skip: json extension not available');
-?>
+<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php