Arrays, functions and code organisation
Two kinds of array, the named function with its arguments and return value, the scope a variable lives in, and the ways one file reaches another: include, require, a namespace, and autoloading the classes with Composer.
3.1
Arrays
create an array, read by offset, append and loop over it
Open
3.2
Associative arrays
keys mapped to values: iterate, check a key, and sort
Open
3.3
Functions
arguments, defaults and return values in a named function
Open
3.4
Variable scope
local scope, global, static and references
Open
3.5
include and require
split code across files with include and require, paths from __DIR__
Open
3.6
Namespaces
declare a namespace, import with use, and reach the global one
Open
3.7
Composer and autoloading
install packages and autoload classes with Composer and PSR-4
Open