PHP – or Keyword
The PHP or keyword is a logical operator. The return value will be true if any one of the statements returns true, otherwise it will return false.
The PHP or keyword is a logical operator. The return value will be true if any one of the statements returns true, otherwise it will return false.
The PHP print keyword is used to output text. Unlike echo, print can only output one string at a time.
The PHP private keyword is an access modifier that marks a property or method as private.
The PHP protected keyword is an access modifier. It marks a property or method as protected.
The PHP public keyword is an access modifier, and marks a property or method as public (meaning it can be used by any code that can access the object).
The PHP require keyword is used to embed PHP code from another file. If the file is not found, a fatal error is thrown and the program stops.
The PHP require_once keyword is used to embed PHP code from another file.
The PHP return keyword ends a function and uses the result of an expression as the return value of the function.
The PHP static keyword is used to declare properties and methods of a class as static (can be used without creating an instance of the class).
The PHP switch keyword is used to create a switch conditional, which choose a block of code to run based on the value of an expression.
The PHP throw keyword is used to throw exceptions to change the program flow if an unexpected situation arises, such as invalid data.
The PHP trait keyword is used to create traits, which are a way to allow classes to inherit multiple behaviors.
The PHP try keyword is used to create a try…catch, or a try…catch…finally statement.
The PHP use keyword tells a class to inherit a trait and it gives an alias to a namespace.
The PHP while keyword is used to create a while loop and is also used to set the looping condition of a do…while.
The PHP xor keyword is a logical operator that’s return value will only be true if one of the statements is true and the other one is false.
The PHP yield keyword is used to create a generator function which acts as iterators which can be looped through with a foreach loop.
The PHP yield from keyword is used to create a generator function which acts as iterators which can be looped through with a foreach loop.