Re: Function variables in classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi paul,
  Why you are trying to use the scope resolution operator see you can use
this way simply.

Code:
******
<?php
class foobar {
    function bar2 () {
        echo "Yep, in bar2() right now\n";
    }

    public function foo2 () {
        $a = "bar2";            // Experiment 0
        $a();                   // Fatal error
    }
}
    $foo = new foobar();
    $funname = "bar2";
    $foo->$funname();  
?>
-- 
View this message in context: http://www.nabble.com/Function-variables-in-classes-tf4730655.html#a13545465
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux