Re: $class::bar() yields parse error

From: Date: Mon, 29 Oct 2001 10:57:49 +0000
Subject: Re: $class::bar() yields parse error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-69273@lists.php.net to get a copy of this message
At 11:33 29/10/2001, Sebastian Bergmann wrote:
Calling static methods on 'variable' classes currently yields a parse error:
    <?php
    class foo {
      function bar() {
        echo 'foobar';
      }
    }
    $class = 'foo';
    $class::bar();
    ?>
I think it would be great if the above syntax would be possible. Any technical obstacles, comments?
Yes, currently this has to be resolved in compile time. This may (probably will) change in the Engine 2.0. Zeev

« previous php.dev (#69273) next »