<?php
class Produto {
public $cpu;
public $mb;
public $psu;
public function __construct($cpu, $mb, $psu) {
$this->cpu = $cpu;
$this->mb = $mb;
$this->psu = $psu;
}
}
$produto = new Produto('Core i7 7700', 'Z270', '500W');
echo $produto->cpu; // Core i7 7700
$produto->mb = 'Z271';
echo $produto->mb; // Z271
PD9waHAKY2xhc3MgUHJvZHV0byB7CiAgICBwdWJsaWMgJGNwdTsKICAgIHB1YmxpYyAkbWI7CiAgICBwdWJsaWMgJHBzdTsKCiAgICBwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoJGNwdSwgJG1iLCAkcHN1KSB7CiAgICAgICAgJHRoaXMtPmNwdSA9ICRjcHU7CiAgICAgICAgJHRoaXMtPm1iID0gJG1iOwogICAgICAgICR0aGlzLT5wc3UgPSAkcHN1OwogICAgfQp9CgokcHJvZHV0byA9IG5ldyBQcm9kdXRvKCdDb3JlIGk3IDc3MDAnLCAnWjI3MCcsICc1MDBXJyk7CmVjaG8gJHByb2R1dG8tPmNwdTsgLy8gQ29yZSBpNyA3NzAwCiRwcm9kdXRvLT5tYiA9ICdaMjcxJzsKZWNobyAkcHJvZHV0by0+bWI7IC8vIFoyNzE=