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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Thu Apr 02 23:01:23 2020 UTC