PHP: Strict Data TypesPHP: Strict Data Types
Title rated 0 out of 5 stars, based on 0 ratings(0 ratings)
Website or Online Data, 2016
Current format, Website or Online Data, 2016, , Available.Website or Online Data, 2016
Current format, Website or Online Data, 2016, , Available. Offered in 0 more formatsLearn about strict data types and scalar type hints in PHP 7. Find out how to use this new and controversial feature consistently in your own code.
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.
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.
Title availability
About
Contributors
Details
Publication
- Carpenteria, CA lynda.com, 2016.
Opinion
More from the community
Community lists featuring this title
There are no community lists featuring this title
Community contributions
There are no quotations from this title
There are no quotations from this title
From the community