Re: figure out members of an object?



www.douglassdavis.com wrote:
>
> Say I am retrieving an object from a function...
....
> Now, there could be two "types" of objects returned, with two distinct
> sets of members.
>
> say one type has a member "prefix" and one has a member "prefix1"
>
> my question is, how can I figure out which type the function has
> returned?

Use get_object_vars() to obtain an associative array of defined object
properties for the returned object. Alternetively, use get_class() to
see the type of the returned object. For more information, see the
Manual:

http://www.php.net/get_object_vars
http://www.php.net/get_class

Cheers,
NC

.



Relevant Pages

  • Re: JavaScript associative arrays not ordered?
    ... will exclude the javascript object. ... Wouldn't a definition of an associative array necessarily exclude everything ... that retrieving a Value stored for a given Key will return the Value ... That would include the javascript Object, exclude js Array, and exclude ...
    (comp.lang.javascript)
  • figure out members of an object?
    ... Say I am retrieving an object from a function... ... The object really has no distinguishable type as far as my code can ... tell (It's from a SOAP function, the objects returned do not have ... sets of members. ...
    (comp.lang.php)
  • Re: Return type
    ... > I want to write a function for retrieving a value from a linked list, ... > given the position as an int. ... Brian ... Prev by Date: ...
    (comp.lang.c)
  • Quotation Marks not converting
    ... When opening an attachment or retrieving ... document, quotation marks will look like @ symbol, why? ... Prev by Date: ...
    (microsoft.public.word.docmanagement)
  • Re: problem with DocumentComplete or READYSTATE_COMPLETE
    ... window it looks as if the page loaded just fine. ... My attempt to capture ... the text from the page seems to be retrieving text from an error page ... Prev by Date: ...
    (microsoft.public.vb.general.discussion)