The "Unknown:"s below indicate that an entry is incomplete.
{ ... } | block (grouping statements, especially when statements are not expressions) |
nothing needed | breaking lines (useful when end-of-line and/or indentation has a special meaning) |
/* ... */ | 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) |
== === != !==(2) | 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) |
Unknown:
tokens (what is the standard way for scrunching together multiple words)
comparison (min / max (binary or more))
force garbage collection
create_function(',','...') | anonymous function |
f(a,b,...) | function call |
f() | function call (with no parameter) |
return(3) | function return value (breaks the control flow) |
Unknown:
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(3) | breaking control flow (returning a value) |
if (c) ... | if_then |
if (c): ... 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)) |
for ($i = 10; $i >= 1; $i--) ... | loop (for each value in a numeric range, 1 decrement) |
for ($i = 1; $i <= 10; $i++) ... | loop (for each value in a numeric range, 1 increment (see also the entries about ranges)) |
for ($i = 1; $i <= 10; $i += 2) ... | loop (for each value in a numeric range, free increment) |
while (c) ... | loop (while condition do something) |
switch (val) { case v1: ...; break; case v2: case v3: ...; break; default: ...; } | multiple selection (switch) |
; | sequence |
Unknown:
loop (forever loop)
loop (do something until condition)
breaking control flow (goto (unconditional jump))
exception (throwing)
exception (catching)
(t) e | cast (upcast) |
class | class declaration |
this | current instance |
get_class | get the type/class corresponding to an object/instance/value |
object->method(para) | method invocation |
get_class_methods | methods available |
o2 = o(4) | object cloning |
$o2 = $o | object cloning |
new | object creation |
new class_name(...) | object creation |
is_a | testing class membership |
Unknown:
method invocation (with no parameter)
manually call an object's destructor
inheritance
has the method
accessing parent method
Unknown:
package scope
declare
import
s[n] | accessing n-th character |
chr | ascii to character |
ord | character to ascii |
(string) e | convert something to a string (see also string interpolation) |
str_repeat | duplicate n times |
substr | extract a substring |
strpos | locate a substring |
strrpos | locate a substring (starting at the end) |
all strings allow multi-line strings | multi-line |
serialize | serialize (marshalling) |
simple print (on strings) | |
echo(5) | simple print (on strings) |
printf | simple print (printf-like) |
sprintf | sprintf-like |
. | string concatenation |
== !== | string equality & inequality |
strlen | string size |
"\n" | strings (end-of-line (without writing the real CR or LF character)) |
"... $v ..." | strings (with interpolation of variables) |
<<<MARK ... $v ... MARK | strings (with interpolation of variables) |
'...' | strings (with no interpolation of variables) |
string | type name |
unserialize | unserialize (un-marshalling) |
strtoupper / strtolower | upper / lower case character |
strtoupper / strtolower | uppercase / lowercase / capitalized string |
false | false value |
NULL | false value |
0(6) | false value |
0.0 | false value |
"" | false value |
"0" | false value |
array() | false value |
! | logical not |
|| / && | logical or / and (short circuit) |
or / and | logical or / and (short circuit) |
true | true value |
bool | type name |
boolean | type name |
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(s, l) | join a list of strings in a string using a glue string |
implode(s, l) | join a list of strings in a string using a glue string |
+ | list concatenation |
array_merge | list concatenation |
array(a, b, c) | list constructor |
count | list size |
a[i] | list/array indexing |
array_unique | remove duplicates |
array_reverse | reverse |
sort(7) | sort |
array_map | transform a list (or bag) in another one |
array | type name |
Unknown:
list flattening
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) |
isset(h[k]), array_key_exists(k, h) | dictionary (has the key ?) |
array_keys | dictionary (list of keys) |
array_values | dictionary (list of values) |
array_merge(8) | dictionary (merge) |
unset(h[k]) | dictionary (remove by key) |
array | dictionary (type name) |
?: | optional value (null coalescing) |
range | range (inclusive .. inclusive) |
Unknown:
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)
+ / - / * / / | addition / subtraction / multiplication / division |
& / | / ^ | bitwise operators (and / or / xor) |
~ | bitwise operators (bitwise inversion) |
<< / >> | bitwise operators (left shift / right shift / unsigned right shift) |
pow | exponentiation (power) |
log10 | logarithm (base 10) |
log | logarithm (base e) |
% | modulo (modulo of -3 / 2 is -1) |
- | negation |
1000.0, 1E3 | numbers syntax (floating point) |
1000 | numbers syntax (integers) |
mathematical | operator priorities and associativities (addition vs multiplication) |
rand | random (random number) |
mt_rand | random (random number) |
srand | random (seed the pseudo random generator) |
sqrt / exp / abs | square root / e-exponential / absolute value |
sin / cos / tan | trigonometry (basic) |
/ round / floor / ceil | truncate / round / floor / ceil |
float | type name (floating point) |
int | type name (integers) |
integer | type name (integers) |
Unknown:
numbers syntax (integers in base 2, octal and hexadecimal)
trigonometry (inverse)