mirror of
https://github.com/php/php-langspec.git
synced 2026-03-24 07:12:08 +01:00
* Fix the `namespace-definition` production The `namespace-definition` production was changed to use `name` instead of `namespace-name` inc1ac531479anda6520fb35b. This appears to be a mistake, since `name` can not produce a `\`. The spec was originally using `namespace-name` for `namespace-definition`. This commit restores that grammar production. * Regenerate using `tools/pre-commit` It appears that the pre-commit scripts were not used to properly regenerate the spec recently. This caused some small styling changes (using html entities for some chars). It also caused a bigger change due to `print` being moved out of the intrinsics section in63d72a6df5. It's not completely clear if this was intentional or not, since `print` is a language intrinsic.
17 KiB
17 KiB
Specification for PHP
Facebook has dedicated all copyright to this specification to the public domain worldwide under the CC0 Public Domain Dedication located at http://creativecommons.org/publicdomain/zero/1.0/. This specification is distributed without any warranty.
(Initially written in 2014 by Facebook, Inc., July 2014)
Table of Contents
- Introduction
- Conformance
- Terms and Definitions
- Basic Concepts
- Program Structure
- Program Start-Up
- Program Termination
- __halt_compiler
- The Memory Model
- General
- Reclamation and Automatic Memory Management
- Assignment
- General
- Value Assignment of Scalar Types to a Local Variable
- Value Assignment of Objects to a Local Variable
- ByRef Assignment for Scalar Types with Local Variables
- ByRef Assignment of Non-Scalar Types with Local Variables
- Value Assignment of Array Types to Local Variables
- Deferred Array Copying
- General Value Assignment
- General ByRef Assignment
- Argument Passing
- Value Returning
- Cloning objects
- Scope
- Storage Duration
- Types
- Constants
- Variables
- Conversions
- Lexical Structure
- Expressions
- General
- Primary Expressions
- General
- Simple Variable
- Dereferencable expression
- Variables
- Constant Access Expression
- Literals
- Intrinsics
- Anonymous Function Creation
- The
newOperator - Array Creation Operator
- Subscript Operator
- Function Call Operator
- Member Access Operator
- Member Call Operator
- Postfix Increment and Decrement Operators
- Prefix Increment and Decrement Operators
- Shell Command Operator
- Scope-Resolution Operator
- The
cloneOperator - Exponentiation Operator
- Unary Operators
instanceofOperator- Logical NOT Operator
- Multiplicative Operators
- Additive Operators
- Bitwise Shift Operators
- Relational Operators
- Equality Operators
- Bitwise AND Operator
- Bitwise Exclusive OR Operator
- Bitwise Inclusive OR Operator
- Logical AND Operator (form 1)
- Logical Inclusive OR Operator (form 1)
- Coalesce Operator
- Conditional Operator
- Assignment Operators
- Compound Assignment
yieldOperator- Print expression
- Logical AND Operator (form 2)
- Logical Exclusive OR Operator
- Logical Inclusive OR Operator (form 2)
- Script Inclusion Operators
- Constant Expressions
- Statements
- Arrays
- Functions
- Classes
- Interfaces
- Traits
- Exception Handling
- Namespaces
- Grammar
- Bibliography