Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Is there an isObject() test?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 626 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    Is there an isObject() test? Link to this post

    I often get "[Notice] Trying to get property of non-object". I would like to find an easy way to test if my variable is an object or not so I can handle the error myself in a more graceful way. Is there a function to test if something is an object?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Is there an isObject() test? Link to this post

    http://php.net/is_object

    Although, usually you can just make sure if its set, if its set then usually you can assume its an object if($object).....

    626 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.