Skip to content

Instantly share code, notes, and snippets.

@jgrossi
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgrossi/6f9e9a90925c913cf4fa to your computer and use it in GitHub Desktop.
Save jgrossi/6f9e9a90925c913cf4fa to your computer and use it in GitHub Desktop.
PHP Namespace for functions
<?php
namespace { // default namespace
function foo()
{
return 'foo function';
}
}
namespace company { // company namespace
function foo()
{
return 'company foo function';
}
}
<h1><?php echo foo() ?></h1>
<h1><?php echo company\foo() ?></h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment