Skip to content

Instantly share code, notes, and snippets.

@stephpy
Created August 23, 2012 13:07
Show Gist options
  • Save stephpy/3436401 to your computer and use it in GitHub Desktop.
Save stephpy/3436401 to your computer and use it in GitHub Desktop.
<?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