1 Nov 2007 12:39
Re: Function variables in classes
Ivar van der Burg <ivar.van.der.burg <at> tros.nl>
2007-11-01 11:39:08 GMT
2007-11-01 11:39:08 GMT
Try using parent::bar2(); instead of foobar::bar2();
Op 1-nov-2007, om 12:10 heeft Paul van Haren het volgende geschreven:
> Hi there,
>
> I'm trying to execute function variables. This works fine outside
> class
> code, but gives a fatal error when run within a class. The demo
> code is
> here:
>
> <?php
>
> function bar1 () {
> echo "Yep, in bar1() right now\n";
> }
>
> function foo1 () {
> bar1();
>
> $a = "bar1";
> print_r ($a); echo "\n";
> $a();
> }
>
> class foobar {
> function bar2 () {
> echo "Yep, in bar2() right now\n";
> }
(Continue reading)
RSS Feed