SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    List Variables Within a class?

    Hey,

    Just wondering is it possible, within a function in class 'x' to find out all the variables declared at the top of class 'x'? Like:

    PHP Code:
    <?php

    class {

        var 
    $a;
        var 
    $b;

        function 
    getVarList() {
            
    // some code here
            
    return arrayVars;
        }
    }
    ?>
    The function getVarList() should return 'a', and 'b'. Is this possible?

    -Peter

  2. #2
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •