Is there a way to get a PHP namespace to allow for calling functions within a namespace as if they were global?
Example:
handle()
Rather than:
prggmr\handle()
Here is my example code:
<?php
require_once 'prggmr/src/prggmr.php';
prggmr\handle(function() {
echo 'This is a test scenario';
}, 'test');
prggmr\signal('test');
Aliasing does not work for functions:
<?php
require 'prggmr/src/prggmr.php';
use prggmr\handle;
handle(function(){
echo "Test";
}, "test");
Results:
Fatal error: Call to undefined function handle()