PageRenderTime 53ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/samples/get_class.php

https://github.com/hnw/php425
PHP | 19 lines | 16 code | 3 blank | 0 comment | 0 complexity | c883d895155cac388dbb8be04238ac33 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. class Foo
  3. {
  4. function Baz()
  5. {
  6. echo get_class($this)."\n";
  7. echo get_parent_class($this)."\n";
  8. }
  9. }
  10. class Bar extends Foo
  11. {
  12. }
  13. $foo = new Foo;
  14. $foo->baz();
  15. $bar = new Bar;
  16. $bar->baz();