class Product { private $name; public function setName($name) { $this->name = $name; } public function getName() { return $this->name; } } $product = new Product(); $product->setName("iPhone X"); echo $product->getName(); // Output: iPhone XIn the above code, we have created a Product class with a private property $name and two methods - setName and getName. The setName method sets the name of the product while the getName method returns the name of the product. Package library: There are many package libraries that include the Product class such as Laravel, Symfony, and CodeIgniter. However, the code example provided is not specific to any package library and can be used in any PHP project.