PHP class Keyword
Example
Declare a class:
<?php
class MyClass {
public $number = 5;
}
$obj = new MyClass();
echo
$obj->number;
?>
Try it Yourself »
Definition and Usage
The class
keyword is used to create classes.
Related Pages
Read more about classes in our PHP Classes and Objects Tutorial.
❮ PHP Keywords