@oschonrock @ramsey @woozle @cptwtf @IceWolf PHP doing runtime coercions is related, but different, to its type system. And C pointer aliasing rules are a *thing* (and this ignoring type punning and void* hell).
Top-level
@oschonrock @ramsey @woozle @cptwtf @IceWolf PHP doing runtime coercions is related, but different, to its type system. And C pointer aliasing rules are a *thing* (and this ignoring type punning and void* hell). 4 comments
@Girgias @ramsey @woozle @cptwtf @IceWolf With regards to "nullptr" and "void*"... php just doesn't have an equivalent, because php does not allow manual memory management. Really this is a pointless discussion from my point of view. php and C or C++ are not comparable languages in almost every conceivable way. A more useful questions might be: When would using either language make sense: Would I write a server side webapp in C or C++? Prob not. Like using a tank to squash an ant. @oschonrock @Girgias @ramsey @cptwtf @IceWolf Well... I'd say "usually" or "by default", not "never". You can set the type for a member in a class, and get an error if you try to assign it a value of an incompatible type. ...but that's a pretty new feature. @woozle @Girgias @ramsey @cptwtf @IceWolf yeah.. and it's also "shallow"... because the type information is "lost" as soon as you call a method on that type and chain a few more calls. I have continued to try to use LSPs in php over the last 2 decades, they have very slowly got better, but as soon as you switch to what I call a "compile time statically typed language" the experience is night and day. |
@Girgias @ramsey @woozle @cptwtf @IceWolf
Please refer to my list above.
in php a variable can change it's type, even without conversion. So the IDE/compiler/interpreter never knows the type at compile time.
that is basically a non-existent type system in my book. And that's from 20yrs of practical experience using the language v4->v8.