Bug #77864 [NEW]: ArrayObject->getIterator not working in PHP 7.4 snapshot?

From: Date: Mon, 08 Apr 2019 17:32:47 +0000
Subject: Bug #77864 [NEW]: ArrayObject->getIterator not working in PHP 7.4 snapshot?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220366@lists.php.net to get a copy of this message
From: jay at diablomedia dot com Operating system: Linux PHP version: master-Git-2019-04-08 (snap) Package: Arrays related Bug Type: Bug Bug description:ArrayObject->getIterator not working in PHP 7.4 snapshot? Description: ------------ I first noticed this in this test suite on travis running on the php7.4-snapshot that's available on Travis (I believe this is a nightly snapshot of the 7.4 branch): https://travis-ci.org/diablomedia/zf1-controller/jobs/517348370 There are two tests that fail there due to get_class trying to operate on a boolean rather than on a class (these tests pass fine in all versions prior to 7.4). Looking at the code a bit, I've been able to narrow the failure down to a simple script that I've added to the "Test script" section of this bug (also on 3v4l.org: https://3v4l.org/KZg3c). In all versions prior to PHP 7.4, this will output int(1) in PHP 7.4 it outputs bool(false). Here's output from php --version in the docker container I was testing this on locally: docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp tommymuehle/docker-alpine-php-nightly php --version PHP 8.0.0-dev (cli) (built: Feb 11 2019 05:57:53) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies (seems that container is on the php 8.0 branch (dev-master I assume), but based on the travis failures I'm fairly certain the same issue exists on the current php 7.4 snapshot as well) Test script: --------------- <?php $array = [1,2,3]; $iterator = (new ArrayObject($array))->getIterator(); var_dump(current($iterator)); Expected result: ---------------- int(1) Actual result: -------------- bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=77864&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77864&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77864&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77864&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77864&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77864&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77864&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77864&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77864&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77864&r=support Expected behavior: https://bugs.php.net/fix.php?id=77864&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77864&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77864&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77864&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77864&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77864&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77864&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77864&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77864&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77864&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77864&r=mysqlcfg

« previous php.bugs (#220366) next »