- BASICS
- Quotes
- Constants
- Control Structures
- Reference
- Number Systems
- VARIABLES
- Definition
- Variable Variable
- Exists
- Type Casting
- OPERATORS
-
Aritmetic
- Bitwise
- String
- Comparison
- Logical
- FUNCTION
- Definition
- Anonymous
- Reference
- Variable Arguments
- ARRAY
- Basics
- Operations
- Create
- Search
- Modify
- Sort
- Storage
- STRING
- String Basics
- String Compare
- String Search
- String Replace
- String Format
- String Regexp
- String Parse
- Formating
- Json
- STREAMS
- File Open
- Read File
- Read Csv
- File Contents
- Context
- Ob_start
- OOP
- Object Instantiation
- Class Constructor
- Interfaces, Abstract
- Resource Visibility
- Class Constants
- Namespaces
- HTTP
- Headers
- File Uploads
- Cookies
- Sessions
Increment
If the operator is placed after its operand, the interpreter will first return the value.
/**
* If the operator is placed after its operand,
* the interpreter will first return the value.
*
* Incrementing or decrementing booleans has no effect.
*/
$a = 1;
echo $a++; // 1
echo ++$a; // 3
$b = true;
var_dump(++$b == true); // true
var_dump($b++ == true); // true
Chars
Arithmetics on chars follows Perl's convention.
/**
* Arithmetics on chars follows Perl's convention
*/
$i = 'W';
for ($n=0; $n<6; $n++) {
echo ++$i . " "; // X Y Z AA AB AC
}
Last update: 531 days ago