From 0aaa862fcf502dba1c7161f539154b2fd37b0515 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 2 Jun 2021 12:17:17 +0200 Subject: [PATCH] Add test for unsetting ReflectionClassConstant::$name This test was supposed to be part of 50b4a7adf955a1fea4e0d24e9362d79a5a6b329f. --- .../ReflectionClassConstant_unset_name.phpt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ext/reflection/tests/ReflectionClassConstant_unset_name.phpt diff --git a/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt b/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt new file mode 100644 index 00000000000..a571f4a4776 --- /dev/null +++ b/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt @@ -0,0 +1,28 @@ +--TEST-- +Unsetting name on ReflectionClassConstant +--FILE-- +name); +try { + var_dump($rc->getName()); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +try { + echo $rc, "\n"; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +Typed property ReflectionClassConstant::$name must not be accessed before initialization +Typed property ReflectionClassConstant::$name must not be accessed before initialization