List all declared variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tyno Gendo

    List all declared variables

    I don't really need to do this, but I was wondering. Is there some way
    of obtaining a list of all the variables that have been declared in a
    PHP script ?

    Ie. for globals you have $_GLOBAL, is there something that would let you
    know the name of all variables that have been declared?

    Ta.
  • mickysoft.org@gmail.com

    #2
    Re: List all declared variables

    On Apr 11, 5:38 pm, Tyno Gendo <you@localhostw rote:
    I don't really need to do this, but I was wondering. Is there some way
    of obtaining a list of all the variables that have been declared in a
    PHP script ?
    >
    Ie. for globals you have $_GLOBAL, is there something that would let you
    know the name of all variables that have been declared?
    >
    Ta.
    get_defined_var s

    (PHP 4 >= 4.0.4, PHP 5)

    get_defined_var s - Returns an array of all defined variables
    Description
    array get_defined_var s ( void )

    This function returns a multidimensiona l array containing a list of
    all defined variables, be them environment, server or user-defined
    variables, within the scope that get_defined_var s() is called.

    Comment

    • Tyno Gendo

      #3
      Re: List all declared variables

      mickysoft.org@g mail.com wrote:
      On Apr 11, 5:38 pm, Tyno Gendo <you@localhostw rote:
      >I don't really need to do this, but I was wondering. Is there some way
      >of obtaining a list of all the variables that have been declared in a
      >PHP script ?
      >>
      >Ie. for globals you have $_GLOBAL, is there something that would let you
      >know the name of all variables that have been declared?
      >>
      >Ta.
      >
      get_defined_var s
      >
      (PHP 4 >= 4.0.4, PHP 5)
      >
      get_defined_var s - Returns an array of all defined variables
      Description
      array get_defined_var s ( void )
      >
      This function returns a multidimensiona l array containing a list of
      all defined variables, be them environment, server or user-defined
      variables, within the scope that get_defined_var s() is called.
      >
      Interesting. And a function for getting defined functions and
      classes... nice. As I say, don't actually need to use them at the
      moment but that's good to know they are there!

      So many functions, I should randomly read through the manual and ponder
      over what's there :-)

      Comment

      • Martin Mandl - m2m tech support

        #4
        Re: List all declared variables

        On Apr 11, 4:58 pm, Tyno Gendo <you@localhostw rote:
        Interesting. And a function for getting defined functions and
        classes... nice. As I say, don't actually need to use them at the
        moment but that's good to know they are there!
        >
        So many functions, I should randomly read through the manual and ponder
        over what's there :-)
        That would be get_declared_cl asses and get_defined_fun ctions.

        You should really start reading the manual completely ;)

        Cheers
        Martin


        ------------------------------------------------
        online accounting on bash bases
        Online Einnahmen-Ausgaben-Rechnung

        ------------------------------------------------
        m2m server software gmbh


        Comment

        Working...