3 ms·
And this one had a purpose. Remember, PHP was designed (as much as it was "designed") for less-technical people. And everything comes through $_GET and $_POST
by Izkata 4y ago
And this one had a purpose. Remember, PHP was designed (as much as it was "designed") for less-technical people. And everything comes through $_GET and $_POST as strings.
The way I see it, this was a crude attempt to make things like $_GET['age'] > 18 work without having to remember to convert types manually.
Javascript was the same with input.value
The == conversions become more intuitive if you keep this use case in mind and think about semantic equality instead of programming's more traditional exact equality.