Good afternoon everyone! How do I create a chained method, being it a static method? example:
echo class :: meumétodo-> variable;
Thank you
Good afternoon everyone! How do I create a chained method, being it a static method? example:
echo class :: meumétodo-> variable;
Thank you
Copy this and paste it and see how it works, go for the tests.
class Test { public static $attr = "Hello"; public static function testa(){ echo "Olá eu sou o testa"; return new static(); } } $ola = Test::testa()::$attr; var_dump($ola);
The new static()
returns the class Test