2nd Edition. — Apress, 2016. — 160 p.
This pocket reference guide has been updated with the new PHP 7.0 release. It is a condensed, code-rich scripting and syntax handbook for the PHP scripting language. PHP 7 Quick Scripting Reference presents the essential PHP syntax in a well-organized format.
You won't find any technical jargon, bloated samples, drawn out history lessons or witty stories in this book. What you will find is a Web scripting language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any PHP programmer or Web developer.
In it, you will find a concise reference to the PHP 7 scripting language syntax. It includes short, simple and focused code examples and a well laid out table of contents and a comprehensive index allowing easy review.
About the AuthorAbout the Technical ReviewerChapter 1: Using PHPEmbedding PHP
Outputting Text
Installing a Web Server
Hello World
Compile and Parse
Comments
Chapter 2: VariablesDefining Variables
Data Types
Integer Type
Floating-Point Type
Bool Type
Null Type
Default Values
Chapter 3: OperatorsArithmetic Operators
Assignment Operators
Combined Assignment Operators
Increment and Decrement Operators
Comparison Operators
Logical Operators
Bitwise Operators
Operator Precedence
Additional Logical Operators
Chapter 4: StringString Concatenation
Delimiting Strings
Heredoc Strings
Nowdoc Strings
Escape Characters
Character Reference
String Compare
Chapter 5: ArraysNumeric Arrays
Associative Arrays
Mixed Arrays
Multi-Dimensional Arrays
Chapter 6: ConditionalsIf Statement
Switch Statement
Alternative Syntax
Mixed Modes
Ternary Operator
Chapter 7: LoopsWhile Loop
Do-while Loop
For Loop
Foreach Loop
Alternative Syntax
Break
Continue
Goto
Chapter 8: FunctionsDefining Functions
Calling Functions
Function Parameters
Default Parameters
Variable Parameter Lists
Return Statement
Scope and Lifetime
Anonymous Functions
Closures
Generators
Built-in Functions
Chapter 9: ClassInstantiating an Object
Accessing Object Members
Initial Property Values
Constructor
Destructor
Case Sensitivity
Object Comparison
Anonymous Classes
Closure Object
Chapter 10: InheritanceOverriding Members
Final Keyword
Instanceof Operator
Chapter 11: Access LevelsPrivate Access
Protected Access
Public Access
Var Keyword
Object Access
Access Level Guideline
Chapter 12: StaticReferencing Static Members
Static Variables
Late Static Bindings
Chapter 13: ConstantsConst
Define
Const and define
Constant Guideline
Magic Constants
Chapter 14: InterfaceInterface Signatures
Interface Example
Interface Usages
Interface Guideline
Chapter 15: AbstractAbstract Methods
Abstract Example
Abstract Classes and Interfaces
Abstract Guideline
Chapter 16: TraitsInheritance and Traits
Trait Guidelines
Chapter 17: Importing FilesInclude Path
Require
Include_once
Require_once
Return
_Autoload
Chapter 18: Type DeclarationsArgument Type Declarations
Return Type Declarations
Strict Typing
Chapter 19: Type ConversionsExplicit Casts
Set type
Get type
Chapter 20: Variable TestingIsset
Empty
Is_null
Unset
Null Coalescing Operator
Determining Types
Variable Information
Chapter 21: OverloadingProperty Overloading
Method Overloading
Isset and unset Overloading
Chapter 22: Magic Methods_ToString
_Invoke
Object Serialization
_Sleep
_Wakeup
Set State
Object Cloning
Chapter 23: User InputHTML Form
Sending with POST
Sending with GET
Request Array
Security Concerns
Submitting Arrays
File Uploading
Superglobals
Chapter 24: CookiesCreating Cookies
Cookie Array
Deleting Cookies
Chapter 25: SessionsStarting a Session
Session Array
Deleting a Session
Chapter 26: NamespacesCreating Namespaces
Nested Namespaces
Alternative Syntax
Referencing Namespaces
Namespace Aliases
Namespace Keyword
Namespace Guideline
Chapter 27: ReferencesAssign by Reference
Pass by Reference
Return by Reference
Chapter 28: Advanced VariablesCurly Syntax
Variable Variable Names
Variable Function Names
Variable Class Names
Chapter 29: Error HandlingCorrecting Errors
Error Levels
Error-Handling Environment
Custom Error Handlers
Raising Errors
Chapter 30: Exception HandlingTry-catch Statement
Throwing Exceptions
Catch Block
Finally Block
Rethrowing Exceptions
Uncaught Exception Handler
Errors and Exceptions
Chapter 31: AssertionsAssert Performance