I started off writing PHP like a typical newbie programmer: procedural -> "OOP" (in quotes because I was just putting random classes together without any sort of concept of what OOP really was), and eventually more sensible OOP.
The more I learned and applied OO designs, the more I began relying on PHP's object type hints and interfaces to make it easier to reason about my code while also keeping it loosely coupled.
Later on a switched to UI engineering via JavaScript because that's where the jobs were, and I deeply miss even PHP's relatively loose typing, but typing nonetheless. It's a free-for-all of object literals, and while JS can be quite terse and elegant, you lose much of that terseness by writing unit tests or null checks to cover scenarios that PHP type hinting covers for you at the language level.
And square peg / round hole bugs absolutely do manifest themselves in JS because of this. More regressions happen, the meaning and intent of unit tests gets lost in all of the additional safety checks you need to write etc.
Plus I've found PHP code to be FAR easier to reason about because of all of the type hints in function arguments. You KNOW what's expected of an argument because it flat out tells you.