Include a PHP file inside an array

Please Use Below code

<?php
$addcats = array();
ob_start();
require 'custom_menu_addon.php';
$addCats = ob_get_clean();
wp_nav_menu(array(
    'theme_location' => 'menu-1',
    'menu_id' => 'primary-menu',
    'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s<div class="my-div">' . $addCats . '</div></ul>'
));

I’ve edited this answer after some research into the usage of this object array and put it in context with my code, works well on the site 🙂