empty and ArrayObject

Many PHP programmers make extended use of ArrayObject. Extending the ArrayObject class allows developers to create objects that behave like traditional arrays in PHP, which is very useful. A frequent problem with those objects, is that when using the empty construct on inaccessible properties, it will call the __isset overloading method. So, if your property is empty but exists, empty will return true.

An easy workaround is assigning your property to another variable, then calling empty on your variable.

Know a better workaround? Feel free to add it in the comments.