-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No return from array_unique() with Nested arrays halts and throws array to string conversion #7239
Comments
PHPUnit converts notices to exceptions, so this looks like it's working as expected. If you're not using an error handler that converts everything to exceptions, you get the array returned. |
@simonwelsh I've looked into the information you noted on "PHPUnit converts notices to exceptions" I'm not sure I agree that is the whole issue. Based on your information I would have to assume that my other HHVM php7 compatibility issue is related to "PHPUnit converts notices to exceptions", yet when in testing with just PHP7 we get the notices but tests continue. Seems to me that there is something more going on than just "PHPUnit converts notices to exceptions" which is causing HHVM to halt or not return values. |
It seems like the underlying problem is that array_unique() is complaining about an array to string conversion when it shouldn't. |
@aorenste PHP is simply special-casing the |
this was my original test case https://3v4l.org/OfMqV this is a modified version of that test case following @nikic 's changes https://3v4l.org/vHUAv |
Here is a test case that uses It seems to work for hhvm 3.15+ but causes |
@photodude The hhvm 3.14.4 error is an issue with 3v4l.org's config currently. :( |
@Orvid is the hhvm 3.14.4 config issues on 3v4l related to 3v4l enabling the hhvm php7 mode ? see this item https://3v4l.uservoice.com/forums/219058-general/suggestions/16257685-hhvm-in-php-5-mode |
Looks like this is still an issue with HHVM 3.18.1 |
closing as per https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html |
HHVM Version 3.12.5 / 3.14.3 / 3.18.1
Standalone code, or other way to reproduce the problem
No return from array_unique() with Nested arrays halts and throws array to string conversion
Happens with two nested arrays merged and made unique
array_unique(array_merge($this->_links, $data['links']))
Related issue #1561
Expected result
Should return a new array without duplicate values ignoring internal
array to string conversion
notices from the nested arraysActual result
no array is returned, just the
array to string conversion
notice is thrownThe text was updated successfully, but these errors were encountered: