Skip to content

Instantly share code, notes, and snippets.

@wbars
Created September 11, 2015 00:35
Show Gist options
  • Save wbars/2442d44fd67b6e7b5937 to your computer and use it in GitHub Desktop.
Save wbars/2442d44fd67b6e7b5937 to your computer and use it in GitHub Desktop.
class Ancestor
{
private static test()
{
echo "Ancestor::test";
}
public static proxy()
{
self::test();
}
}
class Offspring extends Ancestor
{
private static test()
{
echo "Offspring::test";
}
}
Offspring::proxy();
@ivkalita
Copy link

<?php
    class Ancestor
    {
        private function test()
        {
            echo "Ancestor::test";
        }

        public function proxy()
        {
            $this->test();
        }
    }

    class Offspring extends Ancestor
    {
        private function test()
        {
            echo "Offspring::test";
        }
    }

    $of = new Offspring();
    $of->proxy();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment