[ create a new paste ] login | about

Link: http://codepad.org/5kPLusX8    [ raw code | output | fork ]

PHP, pasted on Jun 22:
<?php

   class foo
    {
        public static function a()
        {
            $foo = new foo;
            return $foo->bar(); 
        }

        private function bar()
        {
            return $this;
        }

        public function b()
        {
            return 1;
        }
    }

    print foo::a()->b();


Output:
1
1


Create a new paste based on this one


Comments: