Test if an item is an object or a reference to an object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • laredotornado@zipmail.com

    #1

    Test if an item is an object or a reference to an object

    Hi,

    Using php 4.4.4, let's say I have an array of objects or references to
    objects. If I picked out an arbitrary element, $n, how would I know
    if that was an object or a reference to an object?

    Thanks, - Dave

  • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

    #2
    Re: Test if an item is an object or a reference to an object

    laredotornado@z ipmail.com wrote:
    Using php 4.4.4, let's say I have an array of objects or references to
    objects. If I picked out an arbitrary element, $n, how would I know
    if that was an object or a reference to an object?
    You can't.

    --
    ----------------------------------
    Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-


    Proudly running Debian Linux with 2.6.17-1-amd64-k8 kernel, KDE3.5.3, and
    PHP 5.2.0-8 generating this signature.
    Uptime: 23:30:18 up 9 days, 4:30, 1 user, load average: 0.79, 0.43, 0.36

    Comment

    • Rik

      #3
      Re: Test if an item is an object or a reference to an object

      laredotornado@z ipmail.com <laredotornado@ zipmail.comwrot e:
      Using php 4.4.4, let's say I have an array of objects or references to
      objects. If I picked out an arbitrary element, $n, how would I know
      if that was an object or a reference to an object?
      Why does it matter? Look at it this way: all variables are references to
      specific values in memory, sometimes more variables then one reference
      this bit, often it's just a single one.

      What's the actual problem you're trying to solve?
      --
      Rik Wasmus

      Comment

      Working...