diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-24 16:41:18 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-24 16:42:16 +0100 |
| commit | 706241f82d675421766b23fad4923f22b2c8e32c (patch) | |
| tree | cb6a9dc02319d00c78a0f19ccd75056f6c54c1bc /ext/reflection/tests/ReflectionParameter_ctor_cast.phpt | |
| parent | d016434ad33284dfaceb8d233351d34356566d7d (diff) | |
| download | php-git-706241f82d675421766b23fad4923f22b2c8e32c.tar.gz | |
Fix usage of casted string in ReflectionParameter ctor
Fixes oss-fuzz #27755.
Diffstat (limited to 'ext/reflection/tests/ReflectionParameter_ctor_cast.phpt')
| -rw-r--r-- | ext/reflection/tests/ReflectionParameter_ctor_cast.phpt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt b/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt new file mode 100644 index 0000000000..10f45647e6 --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test method name string cast in ReflectionParameter ctor +--FILE-- +<?php + +class A {} +try { + new ReflectionParameter([ + A::class, + new class { public function __toString() { return 'method'; } } + ], 'param'); +} catch (ReflectionException $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +Method A::method() does not exist |
