Skip to content
academia.sh

Course Beginner

PHP Fundamentals

Published Updated

By the end of this course

Start course

01

Language and Execution

Every request running in a process built from scratch, code and text separated by tags, the conversion rules of variables and types, operators behaving according to type, forms of control flow, and what function signatures enforce.

  1. 01 The PHP Execution Model Measuring which of the silent, return, warning and halts channels a problem is heard through in PHP; execution starting and ending per request, and an uncaught error cutting only that execution.
  2. 02 Syntax and Tags A file with a syntax error never starts running, how that differs from an error thrown during execution, and how code and template mix through tags in a PHP file.
  3. 03 Variables and Data Types How the type of a value in PHP can change without a signal: assignment, the integer limit, floating-point numbers, casts, the undefined variable, and how type declarations behave under strict types mode.
  4. 04 Operators What PHP operators say when they bring two types together: arithmetic with numeric strings, loose and strict equality, concatenation and precedence, division by zero, and the null coalescing operator silencing a warning.
  5. 05 Control Flow How unmatched branches behave in PHP: the difference between switch and match, loose and strict comparison, the lifetime of loop variables, the foreach and reference trap, and a default arm in match turning a halt into silence.
  6. 06 Functions Argument and return behavior in PHP functions: silent swallowing of extra arguments, errors for missing and unknown arguments, default values and static, passing by value and by reference, return types, and making the surplus visible with ...$x.

02

Arrays and Strings

A single ordered map used as both list and dictionary, key normalization, missing keys in nested arrays, how array functions report what they cannot find, and string handling working over bytes.

  1. 01 Indexed and Associative Arrays One array structure used as both a list and a dictionary; the keys '1', 1 and true collapsing into a single key; a decimal key being truncated; normalization applying only to canonical decimal integer strings.
  2. 02 Multidimensional Arrays Nesting arrays inside arrays; a missing inner key giving null with an E_WARNING; array access on null; the null coalescing operator silencing the whole path; reading and writing being separate channels.
  3. 03 Array Functions The filter, map and reduce functions; array_search returning false when it finds nothing; a match at index zero being confused with false in a loose comparison; array_combine with mismatched lengths and a negative str_repeat call throwing ValueError.
  4. 04 String Handling Formatting with sprintf and printf; the byte and character distinction between strlen and mb_strlen; malformed JSON coming back from json_decode as null; telling the cases apart with json_last_error and JSON_THROW_ON_ERROR; the behavior of implode and strlen on an array argument.

03

Request and Response

Request data arriving through superglobals, form data received and validated, the limits of an uploaded file, and the difference between the two forms of including a file.

  1. 01 Superglobals How request data reaches PHP through superglobals: a missing key heard through the warning channel, values that are always strings, and the client choosing the type of a value.
  2. 02 Form Handling Validating strings that arrive from a form with filter_var: failure heard through the return value, converted to null, and a valid 0 confused with failure.
  3. 03 File Uploads How a file upload reports trouble through return values and error codes: move_uploaded_file on a file that was not uploaded, exceeding a server limit, and a request emptied by exceeding post_max_size.
  4. 04 Including Files Through which channel the inclusion of a missing file is heard with include, require and include_once, followed by a course wrap-up that gathers the measurements of fourteen lessons in one table.

Final exam

PHP Fundamentals — Final Exam

In preparation

This course's question bank is not complete yet. The exam opens here automatically once enough questions are added.

Start typing to search.

↑↓ ↵ Esc navigate · open · close