diff --git a/Zend/tests/enum/json_encode.phpt b/Zend/tests/enum/json_encode.phpt index 016ca6107fee..12ed0d3d445a 100644 --- a/Zend/tests/enum/json_encode.phpt +++ b/Zend/tests/enum/json_encode.phpt @@ -18,7 +18,7 @@ enum StringFoo: string { enum CustomFoo implements JsonSerializable { case Bar; - public function jsonSerialize() { + public function jsonSerialize(): mixed { return 'Custom ' . $this->name; } } diff --git a/ext/json/json.stub.php b/ext/json/json.stub.php index 5b0d72cef27e..f819af71f9b5 100644 --- a/ext/json/json.stub.php +++ b/ext/json/json.stub.php @@ -12,8 +12,8 @@ function json_last_error_msg(): string {} interface JsonSerializable { - /** @return mixed */ - public function jsonSerialize(); + /** @tentative-return-type */ + public function jsonSerialize(): mixed; } class JsonException extends Exception diff --git a/ext/json/json_arginfo.h b/ext/json/json_arginfo.h index ee8954c3ed37..447ea568a4fd 100644 --- a/ext/json/json_arginfo.h +++ b/ext/json/json_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6dcef13e46c3dfc2546d3ccc38da07e6c009bbe5 */ + * Stub hash: d6577c7d27442643c86e51d462f51dd6e677d509 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_json_encode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) @@ -20,7 +20,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_last_error_msg, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_JsonSerializable_jsonSerialize, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_JsonSerializable_jsonSerialize, 0, 0, IS_MIXED, 0) ZEND_END_ARG_INFO() diff --git a/ext/json/tests/bug61978.phpt b/ext/json/tests/bug61978.phpt index 8853bdbbd280..283432f8773b 100644 --- a/ext/json/tests/bug61978.phpt +++ b/ext/json/tests/bug61978.phpt @@ -17,7 +17,7 @@ class JsonTest2 implements JsonSerializable { public function __construct() { $this->test = '123'; } - public function jsonSerialize() { + public function jsonSerialize(): mixed { return array( 'test' => $this->test, 'me' => $this diff --git a/ext/json/tests/bug66025.phpt b/ext/json/tests/bug66025.phpt index 8f12fa40ca0f..628adefc6511 100644 --- a/ext/json/tests/bug66025.phpt +++ b/ext/json/tests/bug66025.phpt @@ -4,7 +4,7 @@ Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function) json_decode('', true)]; } diff --git a/ext/json/tests/bug73113.phpt b/ext/json/tests/bug73113.phpt index 36d78ffdd4d1..d22b0c23f71b 100644 --- a/ext/json/tests/bug73113.phpt +++ b/ext/json/tests/bug73113.phpt @@ -6,7 +6,7 @@ Also test that the custom exception is not wrapped by ext/json class JsonSerializableObject implements \JsonSerializable { - public function jsonSerialize() + public function jsonSerialize(): mixed { throw new \Exception('This error is expected'); } diff --git a/ext/json/tests/bug77843.phpt b/ext/json/tests/bug77843.phpt index c525285bf5ab..2709612659c6 100644 --- a/ext/json/tests/bug77843.phpt +++ b/ext/json/tests/bug77843.phpt @@ -5,7 +5,7 @@ Bug #77843: Use after free with json serializer class X implements JsonSerializable { public $prop = "value"; - public function jsonSerialize() { + public function jsonSerialize(): mixed { global $arr; unset($arr[0]); var_dump($this); diff --git a/ext/json/tests/serialize.phpt b/ext/json/tests/serialize.phpt index 288e3f673376..31b36221ef9e 100644 --- a/ext/json/tests/serialize.phpt +++ b/ext/json/tests/serialize.phpt @@ -17,7 +17,7 @@ class NonSerializingTest class SerializingTest extends NonSerializingTest implements JsonSerializable { - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->data; } @@ -25,7 +25,7 @@ class SerializingTest extends NonSerializingTest implements JsonSerializable class ValueSerializingTest extends SerializingTest { - public function jsonSerialize() + public function jsonSerialize(): mixed { return array_values(is_array($this->data) ? $this->data : get_object_vars($this->data)); } @@ -33,7 +33,7 @@ class ValueSerializingTest extends SerializingTest class SelfSerializingTest extends SerializingTest { - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this; } diff --git a/ext/standard/tests/class_object/get_object_vars_variation_004.phpt b/ext/standard/tests/class_object/get_object_vars_variation_004.phpt index 902149ea0ac4..7c21b903adfc 100644 Binary files a/ext/standard/tests/class_object/get_object_vars_variation_004.phpt and b/ext/standard/tests/class_object/get_object_vars_variation_004.phpt differ