Skip to content

No return from array_unique() with Nested arrays halts and throws array to string conversion #7239

@photodude

Description

@photodude

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']))

<?php
error_reporting(E_ALL);
$b = array(
  'index.php' =>
  array(
    'relation' => "Start",
    'relType'  => "rel",
    'attribs'  => array(),
  )
);
$c = array(
  'index.php' => 
  array(
    'relation' => "Start",
    'relType'  => "rel",
    'attribs'  => array(),
  )
);
$u = array_unique(array_merge($b,$c));

Related issue #1561

Expected result

Should return a new array without duplicate values ignoring internal array to string conversion notices from the nested arrays

Actual result

no array is returned, just the array to string conversion notice is thrown

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions