Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // ./fichier_1.php
- define('CLASS_DIR', 'class/');
- set_include_path(".".PATH_SEPARATOR.CLASS_DIR);
- spl_autoload_extensions('.class.php');
- spl_autoload_register();
- use mon\outil\Test;
- $test = new Test();// Output: "Tralala !"
- //./class/mon/outil/Test.class.php
- namespace mon\outil;
- class Test
- {
- public function __construct()
- {
- echo "Tralala !";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment