You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
348 B

3 years ago
  1. <?php
  2. /**
  3. * 把命名空间比喻成文件目录
  4. */
  5. namespace kuangweijian;
  6. $varA=1;
  7. function funcA(){
  8. echo "hello world".PHP_EOL;
  9. }
  10. class ClassA
  11. {
  12. public $varA;
  13. public function funcA(){
  14. echo "hello".PHP_EOL;
  15. }
  16. }
  17. $obj=new ClassA;
  18. $obj->funcA();
  19. ?>