DEV Community


Discussion on: Using isset() and empty() hurts your code

aleksikauppila profile image
Aleksi Kauppila Author

Thanks for your take Gerrit!

I don't care if at that point my cart is an object, an array or a decimal. I also don't care if the cart is NULL or "0" or an empty array, in all cases the cart can be considered to be empty. Just tell me if the cart is empty or not.

I didn't understand this. Could you provide me some sample code, thanks!

Forem Open with the Forem app