by phplovesong · 1y ago · 0 comments
LOL, no its not. PHP has an weak type system, while python is strong. Both are dynamic.
$sum = 10 + "50"; // 60 in PHP
sum = 10 + "50" // TypeError in pythonAlso, you can just flip on strict typing in PHP, and you should know that.
Really, that's probably enough for a lot of cases, because PHP doesn't have operator overloading. Yes, you can add '10' + 10 and get 20, but not if either of those go into any function. If you have a function that needs to do string stuff, you take string stuff in, and you don't have to worry about string operations or coercing ints or anything.