createFromMapAndFilter for PHP.