I read a big chunk of the debate and the weak casting with warnings if the cast cause accuracy loss would be beneficial (“1" is castable to 1 but not "1.1"). As PHP makes in roads to bigger things it needs to have the abilty to adapt to fit potential problems in the best manner possible. A wall of strong easily documenting contract at the interface level would really help with quality control.
If you pass something I write the float value "1.1" and I expect int "1" I will throw an exception as it is indicative that the caller cannot be trusted to look after itself and should not be allowed database access or access to anything else that will in turn cause damage. By design it is basically a wall of fire.
A lot of developers get hung up on the ideology of the worth of contracts being one way, parameter type hinting addresses this imbalance by making it clear on the door in great big letters "I will help you a lot but at a minimum you must do this", which in turn can force errors to be handled at the appropriate level such as an intelligent error messages, logging etc. If it is not at the visible contract level the called code has to be read to deem whether it will handle this well. Does it die, exception, trigger fatal error or worse of all just swallow and hum innocently along( way to much code does this and wastes way to many peoples time after point of inheritance )?
In OOP part of it is managing and allocating responsibilities effectively. Dirty data should not be allowed to be able to infest beyond a clear point, all it does is allow obscurity, complexity and bugs.
There are also the spl classes for types as well but they just cause implementation overhead for the caller even more, exceptions internally add overhead for the person who is writing the called but sometimes not getting that bug phone call and having to go on a fishing expedition to find the error is in someone elses work make it really worth while.
As PHP applications get bigger more and more time gets sucked into fruitless expeditions, to much fruitlessness and people might decide to rewrite in another language that makes the current painful things better harming PHP in the market place. PHP has to perpetually address itself, there is no such things as the spirit of PHP at a technical level which seems to mentioned a few times. The spirit of PHP is in the great wish to communicate ideas, solutions and practices. It exists as the community level, and at that point it exists exceedingly well.
On a technical level there is just the questions "Is it still competitive?", "has this problem been solved elsewhere in an elegant way? etc. Strong typing like weak typing can become a nightmare, the balance is optional meandering between the two used in an intelligent fashion. Intelligence and lack of selfishness is the key.
Anyway I felt a bit sorry the Derick Rethans who I think implemented it as only the first name was mentioned and am a bit appalled/ angry at the loud mouths trying to steam roller him and hope their rude loud ideological single mindedness don't do any real long term damage. It gets me very ranty 🙂
Forcing your responsibility on others is the mindset of the child. Forcing you to uphold and manage the coding contracts they should be dealing with well is no different.