The "Missing:"s below indicate that an entry is incomplete.
| { ... } | block (grouping statements, especially when statements are not expressions) |
| /* ... */ | commenting (non nestable) |
| # | commenting (until end of line) |
| // | commenting (until end of line) |
| < > <= >= | comparison |
| strcmp | comparison (returns 3 values (i.e. inferior, equal or superior)) |
| /** ... */ (1) | documentation comment (non nestable) |
| == === != !== (12) | equality / inequality (shallow) |
| ( ... ) | grouping expressions |
| __LINE__ __FILE__ | information about the current line and file |
| eval | runtime evaluation |
| case-sensitive: variables case-insensitive: keywords, functions, constants... | tokens (case-sensitivity (keywords, variable identifiers...)) |
| [_a-zA-Z][_a-zA-Z0-9]* | tokens (variable identifier regexp) |
| = | variable assignment or declaration (assignment) |
Missing:
tokens (if case sensitive, what is the standard way for scrunching together multiple words)
breaking lines (useful when end-of-line and/or indentation has a special meaning)
comparison (min / max (binary or more))
force garbage collection
| create_function(',','...') | anonymous function |
| f(a,b,...) | function call |
| return | function return value (breaks the control flow) |
Missing:
function call (with no parameter)
function definition
function called when a function is not defined (in dynamic languages)
runtime inspecting the caller information
| continue / break | breaking control flow (continue / break) |
| return | breaking control flow (returning a value) |
| if (c) b | if_then |
| if (c): b endif | if_then |
| if (c) b1 elseif (c2) b2 else b3 | if_then_else |
| if (c): b1 elseif (c2): b2 else: b3 endif | if_then_else |
| c ? b1 : b2 | if_then_else |
| for | loop (for "a la C" (while + initialisation)) |
| while (cond) expr | loop (while condition do something) |
switch (val) {
case v1: expr1; break;
case v2: case v3: expr23; break;
default: expr_else;
} | multiple selection (switch) |
| ; | sequence |
Missing:
loop (forever loop)
loop (do something until condition)
loop (for each value in a numeric range, 1 increment (see also the entries about ranges))
loop (for each value in a numeric range, 1 decrement)
loop (for each value in a numeric range, free increment)
breaking control flow (goto (unconditional jump))
exception (throwing)
exception (catching)
| (t) e | cast (upcast) |
| class | class declaration |
| this | current instance |
| object->method(para) | method invocation |
| get_class_methods | methods available |
| o2 = o (44) | object cloning |
| new | object creation |
| is_a | testing class membership |
Missing:
method invocation (with no parameter)
manually call an object's destructor
get the type/class corresponding to an object/instance/value
inheritance
has the method
accessing parent method
Missing:
package scope
declare
import
| s[n] | accessing n-th character |
| chr | ascii to character |
| ord | character to ascii |
| str_repeat | duplicate n times |
| substr | extract a substring |
| simple print (on strings) | |
| echo | simple print (on strings) |
| printf | simple print (printf-like) |
| sprintf | sprintf-like |
| . | string concatenation |
| strlen | string size |
| '...' | strings (verbatim) |
| "... $v ..." | strings (with interpolation) |
| <<<MARK ... $v ... MARK | strings (with interpolation) |
| strtoupper / strtolower | uppercase / lowercase / capitalized string |
Missing:
character "z"
strings (end-of-line (without writing the real CR or LF character))
multi-line
convert something to a string (see also string interpolation)
serialize (marshaling)
unserialize (un-marshaling)
string equality & inequality
upper / lower case character
locate a substring
locate a substring (starting at the end)
| false / 0 / "" | false value |
| ! | logical not |
| || / && | logical or / and (short circuit) |
| or / and | logical or / and (short circuit) |
| true / anything not false | true value |
| true | true value |
| array_unshift | adding an element at the beginning (list cons) (side-effect) |
| array_push | adding an element at the end (side-effect) |
| foreach | for each element do something |
| array_shift | get the first element and remove it |
| array_pop | get the last element and remove it |
| in_array | is an element in the list |
| foreach($l as $i => $v) | iterate with index |
| join | join a list of strings in a string using a glue string |
| array_merge | list concatenation |
| count | list size |
| a[i] | list/array indexing |
| array_unique | remove duplicates |
| array_reverse | reverse |
| sort | sort |
| array_map | transform a list (or bag) in another one |
Missing:
list flattening
list constructor
adding an element at index
first element
all but the first element
last element
smallest / biggest element
| h[k] | dictionary (access: read/write) |
| array( a => b, c => d ) | dictionary (constructor) |
| array_keys | dictionary (list of keys) |
| array_values | dictionary (list of values) |
| range | range (inclusive .. inclusive) |
Missing:
tuple constructor
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (empty tuple)
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (1-uple)
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (using a tuple for a function call)
reference (pointer) (creation)
reference (pointer) (dereference)
optional value (null value)
optional value (value)
record selector
dictionary (has the key ?)
dictionary (remove by key)
| pow | exponentiation (power) |
| log / log10 | logarithm |
| % | modulo (modulo of -3 / 2 is -1) |
| sqrt / exp / abs | square root / e-exponential / absolute value |
| sin / cos / tan | trigonometry (basic) |
| / round / floor / ceil | truncate / round / floor / ceil |
Missing:
numbers syntax (integers)
numbers syntax (integers in base 2, octal and hexadecimal)
numbers syntax (integer thousand-seperator)
numbers syntax (decimals)
addition / subtraction / multiplication / division
negation
random (random number)
random (seed the pseudo random generator)
operator priorities and associativities
trigonometry (inverse)
bitwise operators