DEV Community

Discussion on: I Want Scalar Objects in PHP

Collapse
 
kaime profile image
Jaume Alemany

This was already proposed,implemented and rejected a few years ago:

github.com/rossriley/php-scalar-ob...

Looks like now it exists as a PHP extension:

github.com/nikic/scalar_objects

Collapse
 
ianfoulds profile image
Ian Foulds

But this would be so much better if it was part of the core and had properly published methods.

PHP needs to grow and keep up with the needs of developers rather than developers continuously getting frustrated with the lack modernity in one of the most popular languages in use. If PHP does not embrace good OOP practices it will loose it's popularity. Given that .NET Core has been available cross platform for some time now, it is becoming a popular draw for those of us who long for something better. If it were not for a host of projects and a large code base I would have moved on already.

Time will tell and for me time is running out with the arcane state PHP is still in, despite the major leap in PHP 7 it's still very old fashioned.

Collapse
 
hsemix profile image
Hamid Semix

I agree with you 100%, If it wasn't for the large code bases I have to maintain every single day, I would be using .Net Core, but hey, I think the killer feature here would be generics. That is really needed.