Okay here is the scenario:
Here are two example classes.
- The first one defines some functions outside the class name.
- I would like the second class to be able to implement it as if it was defined natively.
There are a couple of functions I use a lot.
I thus need them to be as short as possible for readability and writing speed.
If i could stick them in a namespace and extend it in some way, it would also prevent possible conflicts in other libraries.
Base class
namespace Core;
class Base{
......
}
function set($array, $path=null, $value=null){
.....
}
function get($array, $path=null){
.....
}
Second Class
namespace Core\Config;
class Config{
public function __construct($array){
$conf = get($array, 'key1.key2.key3');
.... do something with returned value ....
}
}