Created
March 29, 2012 00:09
-
-
Save loganlinn/2231699 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo { | |
const NUM_FOOS = 42; | |
} | |
class Bar { | |
public $foo; | |
function __construct() { | |
$this->foo = new Foo(); | |
$f = $this->foo; | |
echo $f::NUM_FOOS; // Works | |
//echo $this->foo::NUM_FOOS; // Parse error | |
//echo $this->getFoo()::NUM_FOOS; // Parse error | |
} | |
function getFoo() { | |
return $this->foo; | |
} | |
} | |
$b = new Bar(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment