diff options
| author | Johannes Schlüter <johannes@php.net> | 2010-11-21 12:24:09 +0000 |
|---|---|---|
| committer | Johannes Schlüter <johannes@php.net> | 2010-11-21 12:24:09 +0000 |
| commit | 9ea04e1e46f0e4e01d5c96ddf46a738abeafb73c (patch) | |
| tree | b52fac97730c16294b4ddc7a87e9ae1ed0d3540e /ext/reflection/tests | |
| parent | 1ac484d1a10bbb57760f4bb83b77dc3ae4885dc9 (diff) | |
| download | php-git-9ea04e1e46f0e4e01d5c96ddf46a738abeafb73c.tar.gz | |
- Fix #52854 (ReflectionClass::newInstanceArgs does not work for classes without constructors
Diffstat (limited to 'ext/reflection/tests')
| -rw-r--r-- | ext/reflection/tests/bug52854.phpt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug52854.phpt b/ext/reflection/tests/bug52854.phpt new file mode 100644 index 0000000000..94f79d858b --- /dev/null +++ b/ext/reflection/tests/bug52854.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #52854: ReflectionClass::newInstanceArgs does not work for classes without constructors +--FILE-- +<?php +class Test { +} +$c = new ReflectionClass('Test'); +var_dump(new Test); +var_dump(new Test()); +var_dump($c->newInstance()); +var_dump($c->newInstanceArgs(array())); + +try { + var_dump($c->newInstanceArgs(array(1))); +} catch(ReflectionException $e) { + echo $e->getMessage()."\n"; +} +?> +--EXPECTF-- +object(Test)#2 (0) { +} +object(Test)#2 (0) { +} +object(Test)#2 (0) { +} +object(Test)#2 (0) { +} +Class Test does not have a constructor, so you cannot pass any constructor arguments |
