Skip to content

Instantly share code, notes, and snippets.

@geovanerocha
Created September 24, 2012 17:35
Show Gist options
  • Save geovanerocha/3777199 to your computer and use it in GitHub Desktop.
Save geovanerocha/3777199 to your computer and use it in GitHub Desktop.
Use of namespaces @ PHP.
<?php
require_once 'Foo/FooClass.php';
require_once 'Bar/FooClass.php';
use Foo\FooClass;
use Bar\FooClass as BarClass;
$foo = new FooClass();
$bar = new BarClass();
if ($foo->setData('Fulano de Tal', 'fulanodetal', 'qwert')) {
echo $foo->getName() . ' saved.';
}
$bar->showDifference();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment