DEV Community

Discussion on: is_null vs null in php

Collapse
 
patricnox profile image
PatricNox

A useful addition is empty() which basically can be treated as isset (since it covers it) but for moments where you explictly don't seek to know whether the actual value is set.

empty() also works on object members, whilst isset() does not.

if (empty($object->member)) {
   return true;
}