I had no idea I had a course in PHP this semester, evidently I do and the exam is tomorrow. I need to learn PHP in 18 hours and complete an assignment before the test. Teach me PHP!
>>13 Horrible duck typing. When cast to a boolean, array(), "", "0", 0.0, and 0 all evaluate to false. When cast to an integer, "", "alpha", and "0" all evaluate to 0. Strings cast to an integer uses the part matching ([0-9]+) and discards the rest. Objects cast to an array get their property names as keys.
What you described isn't duck typing.