PHP class Keyword

P
PHP clone Keyword
PHP catch Keyword

In this article, you will learn how to create a class in PHP. The class keyword in PHP is used to create classes.

examples of the CLASS keyword

Example 1. In this example, we declare a class.

<?php
class MyClass {
  public $number = 5;
}

$obj = new MyClass();
echo $obj->number;
?>
PHP clone Keyword
PHP catch Keyword

Tutor Network

Share this

Learn PHP from A to Z