PHP data type assignments
lessonDuration 3m 27s
PHP is a "loosely-typed" language, so it automatically assigns data types at the time of creation. In this lesson, we'll also touch base on how to determine which type of variable PHP assigns.
Browse
Find courses, lessons, articles, talks, and podcasts.
93 resources
Showing 1–24 · Page 1 of 4
lessonDuration 3m 27s
PHP is a "loosely-typed" language, so it automatically assigns data types at the time of creation. In this lesson, we'll also touch base on how to determine which type of variable PHP assigns.
lessonDuration 2m 19s
Expanding on PHP arrays, you can create keys within them to store multi-dimensional, complex data.
lessonDuration 2m 32s
There are many functions available relating to PHP arrays, and one of them is count, to get the total number of elements within an array.
lessonDuration 2m 18s
Sometimes you need to escape out of a PHP loop. You can easily do this by using either the continue or break keywords.
lessonDuration 2m 12s
There's a new way to create class properties in PHP 8. In this lesson, you'll learn about "promoted properties", also referred to as "constructor property promotion".
lessonDuration 3m 38s
Different from a foreach loop, a for loop in PHP allows you to iterate through an array based on an index or another conditional value.
lessonDuration 4m 25sFree
Before you can get started with PHP, you will need to install it. Homebrew is a popular choice on macOS, since it provides the ability to easily switch between different PHP versions. In this lesson, we'll install PHP with Homebrew on macOS.
course
lorem ipsum
lessonDuration 2m 28s
You can't get data into a function without arguments. In this lesson, we'll learn how to pass variables as arguments to PHP functions.
lessonDuration 2m 25s
Learn how to create variables in PHP, and the different naming conventions to use when naming variables.
lessonDuration 3m 24s
You'll eventually need to run a block of PHP code that executes if your "if" statement is false. In this event, you will use an "else"| clause.
lessonDuration 4m 26s
PHP "juggles" data types with something called "type coercion". Let's learn all about that!
lessonDuration 4m 13s
Using "require" for classes isn't a modern practice for PHP development. A much better option is to use Composer's autoloader to automatically import classes into your app.
lessonDuration 4m 19s
Once you start creating PHP classes, you'll want to organize them into groups of classes. In this lesson, you'll learn how to do just that with namespaces.
lessonDuration 3m 18s
Creating functions around your app is just fine, but when your app grows in complexity, you will want to create those functions as being part of PHP classes. This will help your app scale & expand with time.
lessonDuration 4m 1s
Class properties and methods can have different visibility levels, which control how private or protected those properties are.
lessonDuration 1m 43s
Creating class properties is useless unless you can read back that property! There's an easy way to do this, with PHP's shorthand arrow syntax.
lessonDuration 2m 47s
Attaching properties to a PHP class is important, so you can track specific values of data entities or functionality.
lessonDuration 2m 23s
It's very common to execute a piece of code when an object is created. In this lesson, you'll learn how to do just this with a PHP class constructor.
lessonDuration 2m 13s
Creating a class in PHP is quite easy with the "new" keyword, and can represent a specific data entity or functionality.
lessonDuration 4m 18s
Files can get hard to read & debug if they get too long. In this lesson, we'll learn how to include external files in your PHP scripts.
lessonDuration 2m 19s
Types are important in any programming language. In PHP, you can define argument & return types to build more reliable applications.
lessonDuration 3m 33s
A PHP function can encapsulate a block of code, but it can also return values. In this lesson, we will learn how to return values created within a function.
lessonDuration 1m 53s
Scope in PHP is how variables are encapsulated in pieces of code. Let's learn about function & global scope in PHP.