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
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC