Last active
August 29, 2015 14:13
-
-
Save derpixler/25be21daf3add37030ed to your computer and use it in GitHub Desktop.
Play with Namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace project\core\classes; | |
class awesomelass extends someclass { | |
public function __construct() { | |
print_r('.'); | |
die(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace project\core; | |
class init { | |
public function __construct() { | |
require_once( dirname( __FILE__ ) . '/core/classes/someclass.php' ); | |
require_once( dirname( __FILE__ ) . '/core/classes/awesomeclass.php' ); | |
$someclass = new namespace\classes\someclass(); | |
$awesomelass = new namespace\classes\awesomeclass(); | |
} | |
} | |
new init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace project\core\classes; | |
use project\core\init; | |
class someclass extends init { | |
public function __construct() { | |
print_r('someclass'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment