summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-15 10:59:32 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-15 10:59:32 +0200
commit9a1a94e9b9195adf92dbafd681c3b9cf0fc59f07 (patch)
treeb369d976ff8d14e99a0f5c819a2786d7983239c8 /ext/reflection
parentf60cf0cfe7fd335718ba5c24bbd824f157e9ea49 (diff)
parentee7c7a8e26b99e3b25a7d41abfe1a2c37b3f6968 (diff)
downloadphp-git-9a1a94e9b9195adf92dbafd681c3b9cf0fc59f07.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79820
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/tests/bug79820.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug79820.phpt b/ext/reflection/tests/bug79820.phpt
new file mode 100644
index 0000000000..ff81f0e738
--- /dev/null
+++ b/ext/reflection/tests/bug79820.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #79820: Use after free when type duplicated into ReflectionProperty gets resolved
+--FILE--
+<?php
+
+class Test {
+ public stdClass $prop;
+}
+
+$rp = new ReflectionProperty(Test::class, 'prop');
+$test = new Test;
+$test->prop = new stdClass;
+var_dump($rp->getType()->getName());
+$test->dynProp = 42;
+
+$rp = new ReflectionProperty($test, 'dynProp');
+var_dump($rp->getType());
+
+?>
+--EXPECT--
+string(8) "stdClass"
+NULL