Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass
- {
- public static function factory(){
- return new MyClass();
- }
- public function method(){
- echo "Did a method";
- return $this;
- }
- public function method2(){
- echo "Did a method2";
- return $this;
- }
- }
- // code
- MyClass::factory()->method()->method2();
Add Comment
Please, Sign In to add comment