There is also another scenario. Like this:
class base{
public function setParam($key, $callable){
$this->params[$key] = $callable;
}
internal function run(){
foreach($this->params as $key=>$callable)
$callable();
}
}
$base = new Base();
// if internal was possible, users will not be able to call this method outside this file. Especially usefull for frameworks and PHP applications.
$base->run();
If you know what I mean. And yes, PHP isn“t C#, but PHP hosting is cheaper than ASP.NET. So it is pity that internal does not exis
Only thing I really miss from PHP is "internal" access modifier. Before I was making libraries and extensions in C# (like game frameworks, Tiled implementations, GUI loaders). Now, when I am working on my own PHP framework, I really miss internal, I was using it a lot in C#. Is internal planned to be added in PHP 7 or is it already in PHP 5.6 or it will never be added?
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.