Welcome to Zach's Lab 2

1 2 3 4 5 6 7 8 9 10

1 + 2 is 3 (integer)
Two integers result in an integer, nothing special.

1 . 2 is 12 (string)
The . operator returns the concatenation of its right and left arguments as a string.

1 + 2 is 3 (double)
If you add a integer to a decimal, you get the integer and that decimal, like how 1 + 3.5 = 4.5. so it is only right for a computer to convert an integer to a decimal (double), which it does.

1 . 2 is 12 (string)
While the . operator does recognize decimals, it does not with this one because it is 0. It will still convert it to a string, because it has precedence.


Warning: A non-numeric value encountered in /home/stu/zcesare/public_html/3680/lab2/lab2.php on line 66

Warning: A non-numeric value encountered in /home/stu/zcesare/public_html/3680/lab2/lab2.php on line 66
1.0 word + 2 is 3 (double)
The computer recognizes the (double) 1.0 in string '1.0 word' and adds it to the (integer) 2, resulting in a double, while the 'word' is cut off, as strings cannot be used in a double.

1.0 word . 2 is 1.0 word2 (string)
Much like how 1 . 2 is 12, using the dot operator between a string and a number would simply append it to the end of the string.


Fatal error: Uncaught TypeError: Unsupported operand types: string + float in /home/stu/zcesare/public_html/3680/lab2/lab2.php:81 Stack trace: #0 {main} thrown in /home/stu/zcesare/public_html/3680/lab2/lab2.php on line 81