File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug43201.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #43201 (Crash on using unitialized vals and __get/__set)
    3: --FILE--
    4: <?php
    5: class Foo {
    6: 	function __get($k) {
    7: 		return null;
    8: 	}
    9: 	function __set($k, $v) {
   10: 		$this->$k = $v;
   11: 	}
   12: }
   13: 
   14: $c = new Foo();
   15: 
   16: $c->arr[0]["k"] = 1;
   17: $c->arr[0]["k2"] = $ref;
   18: for($cnt=0;$cnt<6;$cnt++) {
   19: 	$ref = chop($undef);	
   20: 	$c->arr[$cnt]["k2"] = $ref;
   21: }
   22: echo "ok\n";
   23: ?>
   24: --EXPECTF--
   25: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 13
   26: 
   27: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 14
   28: 
   29: Notice: Undefined variable: ref in %sbug43201.php on line 14
   30: 
   31: Notice: Undefined variable: undef in %sbug43201.php on line 16
   32: 
   33: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
   34: 
   35: Notice: Undefined variable: undef in %sbug43201.php on line 16
   36: 
   37: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
   38: 
   39: Notice: Undefined variable: undef in %sbug43201.php on line 16
   40: 
   41: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
   42: 
   43: Notice: Undefined variable: undef in %sbug43201.php on line 16
   44: 
   45: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
   46: 
   47: Notice: Undefined variable: undef in %sbug43201.php on line 16
   48: 
   49: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
   50: 
   51: Notice: Undefined variable: undef in %sbug43201.php on line 16
   52: 
   53: Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
   54: ok

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>