2016
Lynda
David Powers
1:10
English
One of the most important (and controversial) new features in PHP 7 is the option to use strict data types, in the form of parameter and return type declarations. Strict typing helps eliminate errors in more complex applications. Its use remains optional though, as many consider it a betrayal of the fundamental principles of a loosely typed language like PHP. In this course, David Powers explores the pros and cons of strict data types in PHP 5 and PHP 7.
First, he introduces the basics of type juggling and type casting in PHP. Then, he reviews strict typing with objects, arrays, and callback functions, which were introduced in PHP 5. He also reviews scalar type hints in PHP 7, which can have unexpected side effects for unwary developers. David concludes with a frank assessment of the practicalities of strict typing, and a simple recommendation that will help most developers use the new feature: define in strict and execute in weak.
Introduction
3m 15s
Welcome
1m 5s
What you should know before watching this course
1m 8s
Using the exercise files
1m 2s
1. Loose vs. Strict Types
16m 50s
How PHP handles data types
4m 9s
Implicit type casting
6m 32s
Explicit type casting
3m 40s
Using strict data types
2m 29s
2. Strict Typing with Objects, Arrays, and Callbacks
19m 36s
Specifying data types for parameters
6m 21s
Return type declarations in PHP 7
2m 40s
Return type declarations with an interface
4m 40s
Changes to error handling in PHP 7
5m 55s
3. Scalar Type Hints in PHP 7
27m 6s
Overview of scalar type declarations
3m 30s
Scalar parameter declarations
6m 2s
Scalar return type declarations
5m 3s
Using parameter and return type declarations together
6m 25s
Unexpected side effects of strict mode
6m 6s
Conclusion
3m 37s
Assessing the merits of strict data types
3m 8s
Goodbye
29s
lynda.com/PHP-tutorials/Strict-Data-Types-PHP/480959-2.html
Download File Size:135.94 MB