DEV Community


Discussion on: PHP is bad for Object-Oriented Programming OOP

matthewjtrask profile image
Matt Trask

7.0 has been out long enough that if an article fails to mention strict typing, scalar type hinting and return types, I feel the author didn't put enough work into the research.

avinint profile image
Bruno Avinint

Not to mention declaring variables with the var keyword. Looks like code written ten years ago.

jorgecc profile image
Jorge Castro Author • Edited

Then how could you set a property?.

Do you want to define as private and to add setter and getter? Then good luck by breaking the performance of the code because of a code that adds nothing but bloat.

jorgecc profile image
Jorge Castro Author

First, PHP support type hinting but it is a mediocre implementation.

PHP does not support to indicates if a field is defined by a class.

But you already know that.