From: [EMAIL PROTECTED]
Operating system: Win 2000
PHP version: 4.0.6
PHP Bug Type: Arrays related
Bug description: array-pointer set in a closs-contruktor becomes reset
<?php
/*
* seams to be a bug
*
* array-position set in the constructor moves back to 1 ??!!
*/
class bug {
var $arr;
function bug() {
$this->arr = array(1,2,3,4,5);
reset($this->arr);
next($this->arr);
next($this->arr); // set to 3. element
echo "current() set to " . current($this->arr) . " in
constructor<br>";
}
function show() {
echo current($this->arr) . "<br>";;
}
}
$o = new bug();
echo "current() should still be 3 but is " . current($o->arr) . "<br>"; //
back on 1. element ??!!
$o->show(); // the same
?>
--
Edit bug report at: http://bugs.php.net/?id=13003&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]