Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
nitnip18153yModern php would include types in the parameters and a return type. I think $b would throw an error rather than be processed.
Other than that I don't see anything wrong with the example.
Just a plain old impractical example seen in every introduction to X course. -
nitnip18153yTo understand modern php (as in, modern php frameworks that have a lot of "magic" built-in),
understanding __call, __callStatic, __get, __set and __construct is very helpful. -
I seldom use optional/default parameters, if I ever do they are anywhere except for class constructors. Other than that I really don't see the problem with them.
-
@KDSBest most languages change the type and value of you function parameter on their own?
>repo about the cool parts of modern php
>literally the first one is already a mindfuck antipattern
rant