helly           Tue Jun 21 02:59:59 2005 EDT

  Added files:                 
    /php-src/tests/classes      array_access_012.phpt 
  Log:
  - Add new test
  

http://cvs.php.net/co.php/php-src/tests/classes/array_access_012.phpt?r=1.1&p=1
Index: php-src/tests/classes/array_access_012.phpt
+++ php-src/tests/classes/array_access_012.phpt
--TEST--
ZE2 ArrayAccess cannot assign by reference
--FILE--
<?php

class ArrayAccessImpl implements ArrayAccess {
        private $data = array();

        public function offsetUnset($index) {}

        public function offsetSet($index, $value) {
                $this->data[$index] = $value;
        }

        public function offsetGet($index) {
                return $this->data[$index];
        }

        public function offsetExists($index) {
                return isset($this->data[$index]);
        }
}

$data = new ArrayAccessImpl();
$test = 'some data';
$data['element'] = NULL; // prevent notice
$data['element'] = &$test;

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--

Fatal error: Objects used as arrays in post/pre increment/decrement must return 
values by reference in %sarray_access_012.php on line %d

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to