php_reserved_words_-_php_keywords

PHP Reserved Words - PHP Keywords

Reserved Words in PHP

  • __halt_compiler() - Halts the compiler execution.
  • abstract - Used to declare abstract classes and methods.
  • and - Logical operator, same as '&&'.
  • array - Used to create an array.
  • as - Used in foreach loops to iterate through arrays.
  • break - Used to exit a loop or switch statement.
  • callable - Used to determine if a variable can be called as a function.
  • case - Used in switch statements to define different cases.
  • catch - Used to handle exceptions.
  • class - Used to declare a class.
  • clone - Used to create a copy of an object.
  • const - Used to define constants.
  • continue - Used to skip the rest of the current loop iteration.
  • declare - Used to set execution directives.
  • default - Used in switch statements as a default case.
  • die() - Equivalent to exit().
  • do - Used to start a do-while loop.
  • echo - Used to output one or more strings.
  • else - Used with if to execute a block of code if the condition is false.
  • elseif - Used with if to execute a block of code if the previous conditions are false.
  • empty() - Used to determine if a variable is empty.
  • enddeclare - Used to end a declare block.
  • endfor - Used to end a for loop.
  • endforeach - Used to end a foreach loop.
  • endif - Used to end an if block.
  • endswitch - Used to end a switch block.
  • endwhile - Used to end a while loop.
  • eval() - Evaluates a string as PHP code.
  • exit() - Terminates the script execution.
  • extends - Used to declare a class that inherits from another class.
  • final - Used to prevent a class from being inherited or a method from being overridden.
  • finally - Used with try-catch to execute code after try and catch blocks.
  • for - Used to start a for loop.
  • foreach - Used to iterate over arrays.
  • function - Used to declare a function.
  • global - Used to access a global variable from within a function.
  • goto - Used to jump to another section of the program.
  • if - Used to execute a block of code if a condition is true.
  • implements - Used to implement an interface.
  • include - Used to include and evaluate a specified file.
  • include_once - Used to include and evaluate a specified file only once.
  • instanceof - Used to determine if an object is an instance of a specific class.
  • insteadof - Used in namespaces to resolve naming conflicts.
  • interface - Used to declare an interface.
  • isset() - Used to determine if a variable is set and is not NULL.
  • list() - Assigns variables as if they were an array.
  • namespace - Used to declare namespaces.
  • new - Used to instantiate a new object.
  • or - Logical operator, same as '||'.
  • print - Used to output one or more strings.
  • private - Access modifier, restricts access to class members to within the class itself.
  • protected - Access modifier, restricts access to class members to within the class itself and its subclasses.
  • public - Access modifier, allows access to class members from outside the class.
  • require - Used to include and evaluate a specified file.
  • require_once - Used to include and evaluate a specified file only once.
  • return - Used to return a value from a function.
  • static - Used to declare static properties and methods.
  • switch - Used to select one of many blocks of code to be executed.
  • throw - Used to throw exceptions.
  • trait - Used to declare traits.
  • try - Used to start a try-catch block.
  • unset() - Used to unset a variable or an element within an array.
  • use - Used to import namespaces or traits.
  • var - Declares a variable in a class.
  • while - Used to start a while loop.
  • xor - Logical operator, exclusive OR.
  • yield - Used to return a value from a generator function.
  • yield from - Delegates to another generator.

This list covers all the reserved words in PHP along with brief descriptions of each.


Snippet from Wikipedia: PHP

PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. PHP was originally an abbreviation of Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.

PHP code is usually processed on a web server by a PHP interpreter implemented as a module, a daemon or a Common Gateway Interface (CGI) executable. On a web server, the result of the interpreted and executed PHP code—which may be any type of data, such as generated HTML or binary image data—would form the whole or part of an HTTP response. Various web template systems, web content management systems, and web frameworks exist that can be employed to orchestrate or facilitate the generation of that response. Additionally, PHP can be used for many programming tasks outside the web context, such as standalone graphical applications and drone control. PHP code can also be directly executed from the command line.

The standard PHP interpreter, powered by the Zend Engine, is free software released under the PHP License. PHP has been widely ported and can be deployed on most web servers on a variety of operating systems and platforms.

The PHP language has evolved without a written formal specification or standard, with the original implementation acting as the de facto standard that other implementations aimed to follow.

W3Techs reports that as of 23 March 2024 (the four months after the PHP 8.3 release), PHP is used by 76.4% of all websites whose programming language could be determined, and 57.2% thereof use PHP 7 which is outdated and known to be insecure. Additionally, PHP 8.0 is no longer supported, meaning the vast majority of PHP users utilize outdated versions, and well over half of all websites, PHP-using or not (whose programming language could be determined) are insecure.

Research More

PHP on the Cloud

PHP on Containers

PHP Courses

Fair Use Source

PHP: PHP Fundamentals, PHP Inventor - PHP Language Designer: Rasmus Lerdorf in 1994; PHP DevOps - PHP SRE, Cloud Native PHP (PHP on Kubernetes - PHP on AWS - PHP on Azure - PHP on GCP), PHP Microservices, PHP Containerization (PHP Docker - PHP on Docker Hub), Serverless PHP, PHP Data Science - PHP DataOps - PHP and Databases (PHP ORM), PHP ML - PHP DL, Functional PHP (1. PHP Immutability, 2. PHP Purity - PHP No Side-Effects, 3. PHP First-Class Functions - PHP Higher-Order Functions, PHP Lambdas - PHP Anonymous Functions - PHP Closures, PHP Lazy Evaluation, 4. PHP Recursion), Reactive PHP), PHP Concurrency - PHP Parallel Programming - Async PHP, PHP Networking, PHP Security - PHP DevSecOps - PHP OAuth, PHP Memory Allocation (PHP Heap - PHP Stack - PHP Garbage Collection), PHP CI/CD - PHP Dependency Management - PHP DI - PHP IoC - PHP Build Pipeline, PHP Automation - PHP Scripting, PHP Package Managers, PHP Modules - PHP Packages, PHP Installation (PHP Windows - Chocolatey PHP, PHP macOS - Homebrew PHP, PHP on Linux), PHP Configuration, PHP Observability (PHP Monitoring, PHP Performance - PHP Logging), PHP Language Spec - PHP RFCs - PHP Roadmap, PHP Keywords, PHP Operators, PHP Functions, PHP Built-In Data Types, PHP Data Structures - PHP Algorithms, PHP Syntax, PHP OOP (1. PHP Encapsulation - 2. PHP Inheritance - 3. PHP Polymorphism - 4. PHP Abstraction), PHP Design Patterns - PHP Best Practices - PHP Style Guide - Clean PHP - PHP BDD, PHP Generics, PHP I/O, PHP Serialization - PHP Deserialization, PHP APIs, PHP REST - PHP JSON - PHP GraphQL, PHP gRPC, PHP Virtualization, PHP Development Tools: PHP SDK, PHP Compiler - PHP Transpiler, PHP Interpreter - PHP REPL, PHP IDEs (JetBrains PHP, PHP Visual Studio Code), PHP Linter, PHP Community - PHPaceans - PHP User, PHP Standard Library - PHP Libraries - PHP Frameworks (Laravel, Symfony, Zend Framework, CakePHP), PHP Testing - PHP TDD, PHP History, PHP Research, PHP Topics, PHP Uses - List of PHP Software - Written in PHP (WordPress, DokuWiki, phpMyAdmin) - PHP Popularity, PHP Bibliography - PHP Courses, PHP Glossary - PHP Official Glossary, PHP GitHub, php.internals, PHP Group, PHP.net, Awesome PHP, PHP Versions, Perl. (navbar_php)

Reserved Words: Programming Language Keywords, aka Reserved Identifiers. (navbar_reserved_words - see also navbar_programming)


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


php_reserved_words_-_php_keywords.txt · Last modified: 2024/04/28 03:12 (external edit)