Created
January 17, 2013 08:54
-
-
Save maeharin/4554660 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 C | |
{ | |
protected $middleware; | |
public function __construct() { | |
$this->middleware = array($this); //Cオブジェクト自身を参照させる | |
} | |
public function call() { | |
echo 'called'; | |
} | |
} | |
$c = new C(); | |
$c->middleware[0]->call(); //protectedだと参照できない!? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment