Skip to content

Instantly share code, notes, and snippets.

@lloc lloc/namespace-use.php
Last active Mar 23, 2018

Embed
What would you like to do?
<?php
require_once 'namespace-class.php';
// Namespace: Using
echo ( new \wctrn\realloc\Post() )->get_content(), PHP_EOL;
// Namespaces: Importing
use \wctrn\realloc\Post;
echo ( new Post() )->get_content(), PHP_EOL;
// Namespaces: Aliasing
use \wctrn\realloc\Post as Talk;
echo ( new Talk() )->get_content(), PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.