I have an array and want to compare its values [closed]

Hello I have an array which is structured as follows,

Array
    (
        [0] => ModelBooking Object
            (
                [category_id] => 2
                [booking_date] => 2025-01-28
                [amount] => 248692
                [category] => Lohn/Gehalt
                [category_type] => revenues
            )
    
        [1] => ModelBooking Object
            (
                [category_id] => 3
                [booking_date] => 2025-01-29
                [amount] => 36000
                [category] => Pflegegeld
                [category_type] => revenues
            )
    
    )

I now want to compare Key 0 with Key 1 to see if the category and category type are identical, so I can add up the amount for identical entries.

What’s the best way to do this? I haven’t found a solution yet.