|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-08-30 09:08 UTC] dbeu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 02:00:01 2025 UTC |
<?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 ?>