You need to read up on the difference between assignment and comparison operators, too.
if($profit = 0){
That output doesn’t come from the code you posted, does it? None of them display hello, goody or dodod.
As your print_r shows, though, you have an array of arrays here. So wouldn’t you need to look at $profit['profit'] to check the values? You could check by displaying the value of $profit as part of your debugging routine.
squints at the op Yes, it would, but… the original post’s code was treating it as an array of integers. Which it isnt. So there’s the original confusion.
Try this which will add linefeeds to every array item:
echo '<pre>';
print_r( $items );
echo '</pre>';
// also try
var_dump( $items );
// and not forgetting to pause script
die( 'optional message to display after stopping program execution' );
// above is good for loops