<?php

class Product
{
    public $name;
    public $price;
    public $weight;
    public $border;
    public $bg;
    public $nameFS;
    public $priceWeightFS;
    public $NDS;

    public function __construct($name, $price, $weight, $border, $bg, $nameFS=20,$priceWeightFS=14, $NDS)
    {
        $this->name = $name;
        $this->price = $price;
        $this->weight = $weight;
        $this->border = $border;
        $this->bg = $bg;
        $this->nameFS = $nameFS;
        $this->priceWeightFS = $priceWeightFS;
        $this->NDS = $NDS;
    }

    public function printInfo(){
        echo "<div style='border: {$this->border}; background: {$this->bg}; font-size: {$this->priceWeightFS}px'>
        <h2 style='font-size: {$this->nameFS}px'>{$this->name}</h2>
        <p>{$this->price}</p>
        <span>{$this->weight}</span>
        </div>";
    }
}

$test = new Product('Яблоки','120','12', '2px solid black', 'white');
$test->printInfo();

?>

