Hello,
Also: In PHP gibt es keine Variablentypen. Man kann eine Zahl als String oder als int behandeln, einen Unterschied macht das nicht.
das ist so nicht ganz richtig. Vergleichsoperatoren etc. führen nur automatische Umwandlungen durch. Nichts desto trotz bietet auch PHP so etwas wie typ-gebundene Vergleichsoperatoren an.
Was die Ausgangsfrage angeht ist es allerdings in der Tat zunächst mal belanglos, ob gegen 42 oder "42" verglichen wird.
MfG
Rouven
--
-------------------
Computer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice. Like drawing, it can be shaped to a variety of ends: commercial, artistic, and pure entertainment. Programmers have a well-deserved reputation for working long hours but are rarely credited with being driven by creative fevers. Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination, but because their imagination reveals worlds that others cannot see. -- Larry OBrien and Bruce Eckel in Thinking in C#
-------------------
Computer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice. Like drawing, it can be shaped to a variety of ends: commercial, artistic, and pure entertainment. Programmers have a well-deserved reputation for working long hours but are rarely credited with being driven by creative fevers. Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination, but because their imagination reveals worlds that others cannot see. -- Larry OBrien and Bruce Eckel in Thinking in C#