Guest User

Untitled

a guest
Sep 19th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  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();
  13. $test->fonctionne();
  14.  
  15. //./class/mon/outil/Test.class.php
  16. namespace mon\outil;
  17. class Test
  18. {
  19.     public function __construct()
  20.     {
  21.         echo "Tralala !";
  22.     }  
  23. }
  24.  
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment