Summary
That brings us to the end of Chapter 4. Let's provide a quick recap for you.
First, we looked at all the scalar types – the simple fundamental data. We learned as well about type juggling between these scalar types and how it can be quite complex and tricky to predict if you rely on automatic type juggling. We learned about the difference between identical and equal and the corresponding operators, ===
and ==
. The gist here was that you are always better off using checks for identity wherever possible so you can avoid the pitfalls of type juggling.
After that, we looked at arrays and iterables, including a quick peek at generators – go and play with them, they are awesome. We also looked at the use of DocBlocks to cover the current lack of rich type information in the language itself when dealing with arrays and iterables and how we can supplement this so that IDEs and QA tools can understand what our arrays and iterators actually contain.
We looked...