What will the following code print? print ‘’four’’ * 200;
+4
A:
Since the string cannot be casted to a number, the multiplication with a string will result in 0.
merkuro
2009-07-01 12:24:20
Numeric strings can be casted to the integer they represent though.
Vinko Vrsalovic
2009-07-02 04:54:11
+5
A:
Yes it would print zero "0" indeed. The thing is PHP will type cast the string value to an integer. This would result in 0 (Zero); and if you times any value with zero you'll get zero.
Good Question Roland!
Conrad
2009-07-01 12:24:39