Get started with 33% off your first certification using code: 33OFFNEW

Glossary of PHP terminology

3 min read
Published on 21st June 2023
PHP

This article offers a comprehensive list of PHP-specific terms that you may encounter as a PHP developer. Understanding these terms and concepts is fundamental to mastering PHP.

Array

An array in PHP is a type of data structure that allows you to store multiple elements under a single variable. Each element can be accessed using its index or key. Learn more

Class

In PHP, a class is a blueprint for creating objects. It can contain properties (variables) and methods (functions). Learn more

Closure

Closures are anonymous functions that can capture variables from the surrounding scope. In PHP, closures are instances of the Closure class. Learn more

Constant

Constants in PHP are simple, unchangeable variables that are defined outside of the usual scope and are accessible everywhere. Learn more

Destructor

A destructor is a special method in a PHP class that is automatically called when an object is destroyed or the script ends. Learn more

Echo

'echo' is a language construct in PHP used to output one or more strings to the browser. Learn more

Function

A function in PHP is a named block of code that can be reused. PHP has many built-in functions and also allows the creation of user-defined functions. Learn more

Global Variable

Global variables in PHP are those declared outside of all functions and are accessible from anywhere in the script, except within functions. To access a global variable inside a function, it needs to be declared as global using the 'global' keyword. Learn more

Include

The 'include' statement in PHP is used to include and evaluate a specified file during the execution of the script. Learn more

Interface

In PHP, an interface is a definition of what methods a class must have. Any class that implements an interface must provide an implementation for all the methods of that interface. Learn more

Namespace

Namespaces in PHP are a way of encapsulating items like classes, functions, and constants. They help to avoid name collisions and to create reusable code. Learn more

Object

An object in PHP is an instance of a class. It's a concrete entity based on the blueprint provided by the class. Learn more

Polymorphism

Polymorphism in PHP is a concept in which methods or functions can be used in multiple forms. It's typically achieved through inheritance and interfaces. Learn more

Variable

In PHP, a variable is a container for storing data. Variable names are case-sensitive and start with a dollar sign ($). Learn more

This glossary provides a basic overview of many common terms you'll encounter in PHP. For more comprehensive learning, it's recommended to refer to the official PHP documentation and practice with real code examples.