From: Dmitry Stogov Date: Fri, 3 Jun 2005 15:38:32 +0000 (+0000) Subject: Added test for 5.0 specific bug #30394 (Assignment operators yield wrong result with... X-Git-Tag: php-5.0.1b1~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3cfb42bbdc7c9d14120977ce008975dd38dc383;p=php Added test for 5.0 specific bug #30394 (Assignment operators yield wrong result with __get/__set) --- diff --git a/Zend/tests/bug30394.phpt b/Zend/tests/bug30394.phpt new file mode 100755 index 0000000000..b69eda4fef --- /dev/null +++ b/Zend/tests/bug30394.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #30394 (Assignment operators yield wrong result with __get/__set) +--FILE-- +_p[ $what ]; + } + + public function __set( $what, $value ) + { + $this->_p[ $what ] = $value; + } + + private $_p = array(); +} + +$c = new Container(); +$c->a = 1; +$c->a += 1; +print $c->a; // --> 2 + +print " - "; +$c->a += max( 0, 1 ); +print $c->a; // --> 4 (!) +?> +--EXPECT-- +2 - 3