php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78746 Inconsistent behavior of reset() on objects
Submitted: 2019-10-24 04:35 UTC Modified: 2019-10-24 04:38 UTC
From: kolesnikov at farpost dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 7.4.0RC4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kolesnikov at farpost dot com
New email:
PHP Version: OS:

 

 [2019-10-24 04:35 UTC] kolesnikov at farpost dot com
Description:
------------
Function reset() returns false when using on Iterator or ArrayObject on PHP 7.4.0RC4, but returns value of first element of array on PHP 7.3.10 and below.

Test script:
---------------
<?php

$iterator = new ArrayIterator([1, 2, 3]);

var_dump(reset($iterator));

Expected result:
----------------
int(1)

Actual result:
--------------
bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-24 04:38 UTC] requinix@php.net
-Summary: Inconsistent behavior of reset() +Summary: Inconsistent behavior of reset() on objects -Status: Open +Status: Not a bug
 [2019-10-24 04:38 UTC] requinix@php.net
See bug #77864.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC