On 12/08/2016 10:52, Lester Caine wrote:
I think the idea *I* am throwing out for discussion is a switch from
global_library($var, ... ) to $var->global_library( ... ) where $var is
now always an object without having every framework creating it's own
version of the wrapper?
So kind of an extension to the "scalar objects" idea (e.g.
https://github.com/nikic/scalar_objects) such that variables can have
arbitrary properties / state rather than just the syntax sugar of
->methodCall() ?
One problem I can see is that like with references and objects, the
meaning of assignment has to change somehow:
$foo = 'hello world';
$foo->setReadonly();
var_dump($foo->isReadonly()); // TRUE
$bar = $foo;
var_dump($bar->isReadonly()); // ? same value, different variable
$foo = 'goodbye world';
var_dump($foo->isReadonly()); // ? same variable, different value
Of course, the same applies whenever you pass the variable into a
function, or return it from one...
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php