If the $instance variable is null, it is created then returned. If it is not null, it is simply returned without being re-created. Your example is equivalent however. Note that my code does not have curly braces for the if-statement, so only the first line after the condition is skipped if the condition is false.
Reputation Points: 395
Solved Threads: 192
Veteran Poster
Offline 1,136 posts
since Aug 2007