From 22aa26d099c7c9e1fddec06f92fd3c8929bbcd98 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:26:36 +0200 Subject: [PATCH] Use standard error message for stack limit in serialize() With GH-16204 merged, we can use the standard error message for the recently-merged GH-16159. --- ext/standard/tests/serialize/gh15169.phpt | 4 ++-- ext/standard/var.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/tests/serialize/gh15169.phpt b/ext/standard/tests/serialize/gh15169.phpt index 677982141abcd..9249a593fbb20 100644 --- a/ext/standard/tests/serialize/gh15169.phpt +++ b/ext/standard/tests/serialize/gh15169.phpt @@ -31,5 +31,5 @@ try { echo $e->getMessage(), "\n"; } ?> ---EXPECT-- -Maximum call stack size reached. Infinite recursion? +--EXPECTF-- +Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/ext/standard/var.c b/ext/standard/var.c index b161caeeda630..248bf086c3caf 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1052,7 +1052,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_ } if (UNEXPECTED(php_serialize_check_stack_limit())) { - zend_throw_error(NULL, "Maximum call stack size reached. Infinite recursion?"); + zend_call_stack_size_error(); return; }