PHP 8.3+

PHP 8 Tutorial & Reference

Types, functions, objects, superglobals, passwords, and PDO prepared statements.

Clear
Popular:

PHP 8.3+ Learning Path

Follow the PHP 8 Curriculum

Read the guides in order from fundamentals to production patterns, or jump to your current skill level.

Showing 23 of 73 guides

PHP 8 Beginner

Embedding PHP in HTML with Standard Tags

How do I open and close PHP so HTML stays valid?

Language Basics 7 min
PHP 8 Beginner

PHP Comments: Line, Block, and Docblocks

How do I comment PHP without commenting out the wrong lines?

Language Basics 7 min
PHP 8 Beginner

PHP Variable Names, Assignment, and Scope Rules

What are the rules for PHP variable names, values, and scope?

Language Basics 8 min
PHP 8 Beginner

PHP Types: Strings, Ints, Floats, Bools, Null, and Arrays

What are the core PHP types and how do I inspect them?

Language Basics 8 min
PHP 8 Intermediate

declare(strict_types=1) and Type Juggling

How do I stop PHP from silently coercing function arguments?

Language Basics 9 min
PHP 8 Beginner

PHP Strings: Concatenation, Interpolation, and Multibyte Length

How do I build and measure strings safely in PHP 8?

Language Basics 8 min
PHP 8 Intermediate

DateTimeImmutable for Time Zones and Formatting

How do I handle dates in PHP without mutating a shared clock?

Language Basics 8 min
PHP 8 Beginner

PHP Functions, Parameters, Return Types, and Defaults

How do I write a PHP function with a return type?

Language Basics 8 min
PHP 8 Intermediate

PHP Closures, Arrow Functions, and use()

How do I pass a small function to array_map or array_filter?

Language Basics 9 min
PHP 8 Beginner

PHP Associative Arrays and Nested Records

How do I store a student record in an associative array?

Language Basics 7 min
PHP 8 Intermediate

array_map, array_filter, and array_column

How do I reshape a list of rows without a manual index loop?

Language Basics 8 min
PHP 8 Intermediate

PHP match Expressions

How do I map a value with match instead of switch?

Language Basics 7 min
PHP 8 Intermediate

The PHP Nullsafe Operator

How do I call a method when the object might be null?

Language Basics 7 min
PHP 8 Intermediate

PHP Exceptions and finally

How do I throw and catch a domain exception?

Language Basics 8 min
PHP 8 Intermediate

preg_match for a Slug

How do I test that a slug contains only lowercase letters and hyphens?

Language Basics 7 min
PHP 8 Intermediate

PHP Named Arguments

How do I call a function with named arguments so defaults stay clear?

Language Basics 7 min
PHP 8 Intermediate

PHP Union Types

How do I accept an int or a numeric string without turning types off?

Language Basics 6 min
PHP 8 Beginner

PHP str_contains, str_starts_with, and str_ends_with

How do I test a string without strpos tricks?

Language Basics 6 min
PHP 8 Intermediate

PHP Randomizer for Unbiased Picks

How do I pick a lesson at random without a biased modulo?

Language Basics 6 min
PHP 8 Beginner

PHP Array Destructuring

How do I unpack the first two lessons from a list?

Language Basics 6 min
PHP 8 Intermediate

PHP First-class Callables

How do I pass a function to array_map without a string name?

Language Basics 6 min
PHP 8 Intermediate

mb_substr for Multibyte Titles

How do I shorten a title without splitting a character?

Language Basics 6 min
PHP 8 Beginner

number_format and Intl for Prices

How do I print a seat price with grouping and two decimals?

Language Basics 6 min

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…