String
Integer
Float (number with decimal point)
Boolean value (either true or false)
Array (collection of data that cannot be mutated)
array<(a class=green>"A", 2)
Addition
Unary positive, makes number positive
Subtraction
Unary negative, makes number negative
Multiplication
Division
Floor division (rounds division down)
Modulo (remainder of division)
Indice
Equals
a+=b is a=a+b
a-=b is a=a-b
a*=b is a=a*b
a/=b is a=a/b
a/=b is a=a//b
a%=b is a=a%b
a&=b is a=a&b
a|=b is a=a|b
a^=b is a=a^b
a>>>=b is a=a>>>b
a><<=b is a=a><<b
Is equal to
Is not equal to
Is not equal to
Checks if two objects are equal and of the same type
Checks if two objects aren't equal or are of different types
The spaceship; in a<=>b, returns 0 if a==b, 1 if a>b, and -1 if a<b
Greater than
Less than
Greater than or equal to
Less than or equal to
AND operator
OR operator
XOR operator
AND operator
OR operator
NOT operator
Concatenates strings
'These are '.'two strings!'
Variable operator
Used to separate parameters
PHP code operator
Applies method to object
$instance->method()
Denotes class of an object
References index of superglobal variables
$_GET["parameter"]
References a array's index
Denotes parameters of a function
Defines a block
Declares end of a line of code
Used for switch cases
Declares a string
Declares a string
The splat; indicates unknown amount of arguments for a parameter and treats them as one tuple
Outputs data to screen
echo "data";
Declares a function
Used for including a class in another class, creating polymorphism
Used for declaring switch statement
Used for declaring case statement in a match statement
Executes code if condition is true
if (condition) {
code;
}
Loops code while a condition is true
while (condition) {
code;
}
do {
code;
}
while (condition);
Loops code for a set amount iterations or for every object in list
for (initialization; condition; update) {
code;
}
foreach (array as variale) {
code;
}
Used for declaring foreach loops
Attempts to execute code and jumps to the subsequent catch on an error
try:
code
Executes code on failed try statement
catch (Exception exception) {
code
}
Executes code on true condition if the last if statement was false
elseif (condition) {
code;
}
Executes code when if or elif isn't executed
else {
code;
}
Used for testing if two variables are the same
Used for applying and logic
Used for applying or logic
Used for applying not logic
Used for declaring foreign files as a variable
Used for importing foreign classes for use in code
Used to give a final value at the end of a method
Used to tell compiler to do nothing
Used to tell compiler to complete the next iteration of a loop
Used to tell compiler to end the loop
Used to handle function with variable for a portion of code
Used to handle class or variable with an alias name
Used to throw a specific error
Used to declare public variable in a method
Used to declare true boolean
Used to declare false boolean
Used to reference the object of the class
Used for declaring new objects from a class
Used for declaring private classes or methods, that cannot be interacted with by other classes
Used for declaring public classes or methods, that can be interacted with by other classes
Used for declaring loop in a while loop
Declares a class
Declares an array
Returns array containing the elements that are not in every array parsed as a parameter
Reads a file into an array
Reads a file into a string
Constructor for a mysqli object
Sends a query string to a mysqli object
Sends HTTP header to client
Sets a cookie
Returns HTTP status code
Returns IP as a long
Returns a boolean based on whether a string is empty
String
Integer
Float
Float with 1 decimal place, the 1 can be modified to imply more decimal places
Integer in hexadecimal (lowercase a b c d e f)
Integer in hexadecimal (uppercase A B C D E F)
Bell or alert, has hex code 0x07
Backspace, has hex code 0x08
Control-X
Control-X
Escape, has hex code 0x1b
Newline, has hex code 0x0a
Space, has hex code 0x20
Space, has hex code 0x20
Vertical tab, has hex code 0x0b
Includes foreign file's class
import module
References a GET parameter
$_GET["parameterName"]
References a GET parameter
References server-side information and header information
Wrapper for accessing resource over HTTP
Wrapper for accessing resource over HTTPS
Wrapper for accessing resource over FTP
Executes a phar archive
Wrapper for acessing file within a compressed folder
Includes foreign file's class
import module
Used to tell compiler the rest of this line is not to be compiled
#This isn't executed