What does HackerNews think of scalar_objects?
Extension that adds support for method calls on primitive types in PHP
https://github.com/nikic/scalar_objects provides it as a plugin, but its not fully fleshed out.
I don't see why appeasing critics should be the goal of PHP.
Removing $ and ; signs doesn't help me at all. I actually like the "$" sign. Maybe little bit less ;, but I don't really notice it.
But I would certainly notice the mess of splitting language syntax into two separate branches.
Breaking changes in language are not fun to address and take away the time from building features.
I would be a lot more happy with generics. Or scalar objects, something like:
$string = "abc";
var_dump($string->length()); // int(3)
var_dump($string->startsWith("a")); // bool(true)
https://github.com/nikic/scalar_objects
That would make PHP standard library a lot easier and fun to use.
https://github.com/nikic/scalar_objects
However scalar methods also creates a bigger discussion around the existing standard library, should functions be duplicated? Etc.
Better in my opinion, because the standard library is mostly functions in the global namespace is to add pipe operator, it has been voted on but not passed yet due to some limitation.
Pipe operator is more flexible because you can use your own functions when chaining.
And then of course there are libraries that does this, which is similar to how Java does it, compare float vs Float.
$len = mb_strlen("wtf");
# call function mb_strlen
$len = s("wtf")->len();
# call function s
# allocate string object
# instantiate string object
# call string ctor
# set property
# call method len
# get property
# call function mb_strlen
# destroy object
There's no way to use a syntax like this without either massive overhead, or massive changes in the engine.There is a somewhat similar experimental project - https://github.com/nikic/scalar_objects - but that's not meant for real world use either.
Personally I think the language, despite its flaws, does its job fine. I don't think it needs turning into Javascript-with-sigils.