private function removeReferenceItemInArray(array &$room)
    {
        $roomCopy = $room;
        $keys = array_keys($room);
        foreach ($keys as $key) {
            if (is_array($roomCopy[$key])) {
                $roomCopy[$key]['_test'] = true;
                if (isset($room[$key]['_test'])) {
                    // It's a reference
                    unset($room[$key]);
                }
            }
        }
    }
private function removeReferenceItemInArray(array &$room)
    {
        $roomCopy = $room;
        $keys = array_keys($room);
        foreach ($keys as $key) {
            if (is_array($roomCopy[$key])) {
                $roomCopy[$key]['_test'] = true;
                if (isset($room[$key]['_test'])) {
                    // It's a reference
                    unset($room[$key]);
                }
            }
        }
    }
private function removeReferenceItemInArray ( array & $ room ) { $ roomCopy = $ room ; $ keys = array_keys ( $ room ) ; foreach ( $ keys as $ key ) { if ( is_array ( $ roomCopy [ $ key ] ) ) { $ roomCopy [ $ key ] [ '_test' ] = true ; if ( isset ( $ room [ $ key ] [ '_test' ] ) ) { // It's a reference unset ( $ room [ $ key ] ) ; } } } }
Remove reference item in array

@param array &$room

@return void

@see http://stackoverflow.com/questions/3148125/php-check-if-object-array-is-a-reference
@author Chris Smith (original source)
Remove reference item in array