hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Method 'ArrayObject::getIterator' returns different results in HHVM and PHP

Open Sanuch opened this issue 11 years ago • 6 comments

Method getIterator always return same object in PHP and new object in HHVM

Sanuch avatar Jan 14 '15 09:01 Sanuch

This actually fails due to HHVM not using a reference to ArrayObject in ArrayIterator as $storage.

Consider this test case http://3v4l.org/ef5at. With that test we see, that the issue is in ArrayIterator: http://3v4l.org/5c5LX

SiebelsTim avatar Jan 14 '15 15:01 SiebelsTim

This is still a valid issue. But it will be a pain to fix :p

SiebelsTim avatar Jan 21 '15 11:01 SiebelsTim

@SiebelsTim: worth reopening?

paulbiss avatar Jan 21 '15 17:01 paulbiss

@paulbiss I can see people running into troubles because objects are passed by reference and people expect that. Unfortunately fixing this is horrible. But I'd reluctantly say yes.

SiebelsTim avatar Jan 21 '15 18:01 SiebelsTim

Thanks ;-( Will wait for a fix.

qfox avatar Apr 21 '15 05:04 qfox

I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.

It appears ArrayObject was removed from hhvm in January of 2020 in this diff. This roughly to hhvm 4.42-ish, but the blogpost does not mention this breaking change.

lexidor avatar May 20 '20 13:05 lexidor