From 3b51eaa6d0a038d79f383210875e3edf839c4564 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Mon, 10 Aug 2026 17:09:07 +0800 Subject: [PATCH] test(json): add test case for JSON exception boundary behavior - Verify json_decode with JSON_THROW_ON_ERROR throws JsonException on invalid input - Confirm json_encode with recursive structure throws JsonException when using JSON_THROW_ON_ERROR - Test json --- .../basic/json-exception-boundary.phpt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/compiler/basic/json-exception-boundary.phpt diff --git a/tests/compiler/basic/json-exception-boundary.phpt b/tests/compiler/basic/json-exception-boundary.phpt new file mode 100644 index 00000000..9e56b43b --- /dev/null +++ b/tests/compiler/basic/json-exception-boundary.phpt @@ -0,0 +1,50 @@ +--TEST-- +JSON optimized functions preserve PHP exceptions and option semantics +--FILE-- + +--EXPECT-- +decode-caught +encode-caught +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +depth-caught