while doing some interview questions I found a question that asks for the output of this code mentioned here.
var_dump(‘0123’ == 123);
This returns bool(true) but how? any logical answer that you can suggest?
I know this == only checks value not data types but string(4) 0123 is equal to int(3) 123 how? This is question hai
Found here: 21 Essential PHP Interview Questions and Answers | Toptal®
Similar result is obtained in JS
i think why is the question
Note:- == is non strict comparison