Guest User

Untitled

a guest
Sep 19th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. // ./fichier_1.php
  4. define('CLASS_DIR', 'class/');
  5. set_include_path(".".PATH_SEPARATOR.CLASS_DIR);
  6.  
  7. spl_autoload_extensions('.class.php');
  8. spl_autoload_register();
  9.  
  10. use mon\outil\Test;
  11.  
  12. $test = new Test();// Output: "Tralala !"
  13.  
  14. //./class/mon/outil/Test.class.php
  15. namespace mon\outil;
  16. class Test
  17. {
  18.     public function __construct()
  19.     {
  20.         echo "Tralala !";
  21.     }  
  22. }
  23.  
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment