operators - Reference - What does this symbol mean in PHP? -
what this?
this collection of questions come every , syntax in php. community wiki, invited participate in maintaining list.
why this?
it used hard find questions operators , other syntax tokens.¹ main thought have links existing questions on stack overflow, it's easier reference them, not re-create on content php manual.
¹ note: since jan 2013, stack overflow does back upwards special characters. surround search terms quotes, e.g. [php] "==" vs "==="
what should here?
if have been pointed here because have asked such question, please find particular syntax below. linked pages php manual along linked questions reply question then. if so, encouraged upvote answer. list not meant substitute help others provided.
the list
if particular token not listed below, might find in list of parser tokens.
&
bitwise operators or references
what mean start php function ampersand? understanding php & (ampersand, bitwise and) operator php "&" operator difference between & , && in php what "&" mean here in php? what & mean in case? what & sign mean in php? what signature mean(&) in php? how "&" operator work in php function? what & in &2 mean in php? when should utilize bitwise operator? is there ever need utilize ampersand in front end of object
=&
references
reference assignment operator in php =& what "=&" / "&=" operators in php mean? what '&=' , '=&' operators do? what =& mean in php?
&=
bitwise operators
what "=&" / "&=" operators in php mean? what '&=' , '=&' operators do?
&&
logical operators
'and' vs '&&' operator difference between & , && in php php: there difference between operators , and && here? php - , / or keywords
%
arithmetic operators
what percent sign mean in php? what php operator % , how utilize in real world examples?
!!
logical operators
double not (!!) operator in php
@
error command operators
what utilize of @ symbol in php? php - 'at' symbol before variable name: @$_post php functions , @functions should utilize @ in php code?
?:
ternary operator
what ?: in php 5.3? what php ? : operator called , do? ?: operator (the 'elvis operator') in php where can read conditionals done ? , : using php 5.3 ?: operator
??
null coalesce operator (since php 7)
c#'s null coalescing operator (??) in php?
:
alternative syntax command structures, ternary operator
what : in php? what ":" mean in php?
::
scope resolution operator
what 2 colons mean in php? what's meaning of php token name t_paamayim_nekudotayim what's difference between :: (double colon) , -> (arrow) in php? what late static bindings in php? static::staticfunctionname() unexpected t_paamayim_nekudotayim, expecting t_ns_separator
\
namespaces
backslash in php -- mean? what \ (backslash) in php (5.3+)?
->
classes , objects
what "->" php operator called , how when reading code out loud? where utilize object operator "->" in php what's difference between :: (double colon) , -> (arrow) in php? what php syntax mean: $var1->$var2 absolutely basic php question "-> " syntax
=>
arrays
what "=>" mean in php? use of => in php what $k => $v in foreach($ex $k=>$v) mean?
^
bitwise operators
how bitwise operator xor ('^') work? what ^ mean in php?
>>
bitwise operators
what >> mean in php?
<<
bitwise operators
strange print behaviour in php?
<<<
heredoc or nowdoc
what <<<end mean in php? php <<<eob in php, "<<<" represent? using <<<con in php what's kind of syntax in php?
=
assignment operators
the 3 different equals
==
comparison operators
php == vs === operator how php equality (== double equals) , identity (=== triple equals) comparing operators differ? php != , == operators the 3 different equals php type-juggling , (strict) greater/lesser comparisons
===
comparison operators
what "===" mean? php == vs === operator how php equality (== double equals) , identity (=== triple equals) comparing operators differ? the 3 different equals php type-juggling , (strict) greater/lesser comparisons
!==
comparison operators
what !== comparing operator in php mean? is there difference between !== , != in php?
!=
comparison operators
php != , == operators is there difference between !== , != in php? comparing, !== versus != what difference between <> , !=
<>
comparison operators
php operator <> php <> operator what difference between <> , != php type-juggling , (strict) greater/lesser comparisons
<=>
comparison operators (since php 7.0)
spaceship (three way comparison) operator
|
bitwise operators
what difference between | , || operators? what using single pipe '|' in function argument do?
||
logical operators
what difference between | , || operators? php - , / or keywords what || mean? the behaviour of or operator in php
~
bitwise operators
what ~ operator mean here?
+
arithmetic operators, array operators
+ operator array in php?
+=
assignment operators
what += used for? what `$page -= 1` in php document mean?
++
incrementing/decrementing operators
understanding incrementing answer below
.=
assignment operators
what difference between .= , += in php to understand line of php
.
string operators
difference between "," , "." in php? what . (dot) in php?
,
function arguments
difference between "," , "." in php?
$$
variable variables
what $$ mean in php? what "$$" in php $function() , $$variable
`
execution operator
what backticks `` called?
<?=
short open tags
what symbol mean in php <?= what '<?=' mean in php? what <?= mean?
[]
arrays
php arrays... is/are meaning(s) of empty bracket? php : meaning of [] php array_push() vs myarray[] what [] mean when reading php array? shorthand arrays: literal
$var = []
empty array
<?
opening , closing tags
are php short tags acceptable use?
...
argument unpacking (since php 5.6)
**
exponentiation (since php 5.6)
#
one-line shell-style comment
what # mean in php? can utilize hashes comments in php?
incrementing / decrementing operators
++
increment operator
--
decrement operator
class="lang-none prettyprint-override">
example name effect --------------------------------------------------------------------- ++$a pre-increment increments $a one, returns $a. $a++ post-increment returns $a, increments $a one. --$a pre-decrement decrements $a one, returns $a. $a-- post-decrement returns $a, decrements $a one.
these can go before or after variable.
if set before variable, increment / decrement operation done variable first result returned. if set after variable, variable first returned, increment / decrement operation done.
for example:
$apples = 10; ($i = 0; $i < 10; ++$i){ echo 'i have ' . $apples-- . " apples. ate one.\n"; }
live example
in case above ++$i
used, since faster. $i++
have same results.
pre-increment little bit faster, because increments variable , after 'returns' result. post-increment creates special variable, copies there value of first variable , after first variable used, replaces value second's.
however, must utilize $apples--
, since first want display current number of apples, , then want subtract 1 it.
you can increment letters in php:
$i = "a"; while ($i < "c"){ echo $i++; }
once z
reached aa
next, , on.
note character variables can incremented not decremented , plain ascii characters (a-z , a-z) supported.
stack overflow posts:
understanding incrementing
php operators symbols
No comments:
Post a Comment