summaryrefslogtreecommitdiff
path: root/Zend/tests/bug43201.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-11-06 14:11:59 +0000
committerDmitry Stogov <dmitry@php.net>2007-11-06 14:11:59 +0000
commit22db451fddcd4869f00da2e864f5adfe09f089df (patch)
tree4dd41985ed19b3ec9de4887b5ed60d8b1351fedb /Zend/tests/bug43201.phpt
parent88c66fe54063b9a6bea3097173cfe08c5999f1a8 (diff)
downloadphp-git-22db451fddcd4869f00da2e864f5adfe09f089df.tar.gz
Fixed bug #43201 (Crash on using unitialized vals and __get/__set)
Diffstat (limited to 'Zend/tests/bug43201.phpt')
-rwxr-xr-xZend/tests/bug43201.phpt54
1 files changed, 54 insertions, 0 deletions
diff --git a/Zend/tests/bug43201.phpt b/Zend/tests/bug43201.phpt
new file mode 100755
index 0000000000..89e1b66727
--- /dev/null
+++ b/Zend/tests/bug43201.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Bug #43201 (Crash on using unitialized vals and __get/__set)
+--FILE--
+<?php
+class Foo {
+ function __get($k) {
+ return null;
+ }
+ function __set($k, $v) {
+ $this->$k = $v;
+ }
+}
+
+$c = new Foo();
+
+$c->arr[0]["k"] = 1;
+$c->arr[0]["k2"] = $ref;
+for($cnt=0;$cnt<6;$cnt++) {
+ $ref = chop($undef);
+ $c->arr[$cnt]["k2"] = $ref;
+}
+echo "ok\n";
+?>
+--EXPECTF--
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 13
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 14
+
+Notice: Undefined variable: ref in %sbug43201.php on line 14
+
+Notice: Undefined variable: undef in %sbug43201.php on line 16
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
+
+Notice: Undefined variable: undef in %sbug43201.php on line 16
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
+
+Notice: Undefined variable: undef in %sbug43201.php on line 16
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
+
+Notice: Undefined variable: undef in %sbug43201.php on line 16
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
+
+Notice: Undefined variable: undef in %sbug43201.php on line 16
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
+
+Notice: Undefined variable: undef in %sbug43201.php on line 16
+
+Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
+ok