diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-10-28 13:47:14 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-10-28 13:47:14 +0000 |
| commit | 39f1f2fcd3985c904233e28e787ef36a500d03f2 (patch) | |
| tree | 1504d477585a64a0101fac6805633deec94e5b9b /ext/reflection/tests | |
| parent | b89ab4a4d5c473278ecda5ce69a90d97e577c4f7 (diff) | |
| download | php-git-39f1f2fcd3985c904233e28e787ef36a500d03f2.tar.gz | |
MFB: Fixed bug #42976 (Crash when constructor for newInstance() or
newInstanceArgs() fails)
Diffstat (limited to 'ext/reflection/tests')
| -rw-r--r-- | ext/reflection/tests/bug42976.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug42976.phpt b/ext/reflection/tests/bug42976.phpt new file mode 100644 index 0000000000..38aed3a400 --- /dev/null +++ b/ext/reflection/tests/bug42976.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #42976 (Crash when constructor for newInstance() or newInstanceArgs() fails) +--FILE-- +<?php + +Class C { + function __construct(&$x) { + $x = "x.changed"; + } +} + +$x = "x.original"; +new C($x); // OK +var_dump($x); + +$rc = new ReflectionClass('C'); +$x = "x.original"; +$rc->newInstance($x); // causes crash +var_dump($x); +$x = "x.original"; +$rc->newInstanceArgs(array($x)); // causes crash +var_dump($x); + +echo "Done\n"; +?> +--EXPECTF-- +string(9) "x.changed" + +Warning: Invocation of C's constructor failed in %s/bug42976.php on line %d +string(10) "x.original" + +Warning: Invocation of C's constructor failed in %s/bug42976.php on line %d +string(10) "x.original" +Done |
