Created
August 23, 2012 13:07
-
-
Save stephpy/3436401 to your computer and use it in GitHub Desktop.
This file contains 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 | |
{ | |
public function bar() | |
{ | |
$copy = clone $this; | |
echo $copy->baz(); | |
} | |
private function baz() | |
{ | |
return 1; | |
} | |
} | |
$foo = new Foo(); | |
echo $foo->bar(); //1 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment