Пример #1
0
echo "<hr>";
$bread->price = 2.25;
echo $bread->price;
echo "<hr>";
/*
* class Food
* Second Object
* $product_name, $product_price, $product_quantity, $product_expenses, $product_expiry_date
*/
$chocolate_sold = 3200;
$chocolate_delivered = 5000;
$chocolate = new Foods('chocolate', 4.25, 5252, 1.23, '18-10-15');
echo "<p><strong>Initial info</strong></p>";
$chocolate->ShowInfo();
echo "<p><strong>What happened next</strong></p>";
$chocolate->InStock($chocolate_sold, $chocolate_delivered);
$chocolate->printProfit($chocolate_sold);
$chocolate->scrap();
echo "<hr>";
$chocolate->expiry_date = '01-10-15';
echo $chocolate->expiry_date;
echo "<br>";
$chocolate->scrap();
echo "<hr>";
/*
* class Hardware
* First Object
* $prod_model, $prod_date_production, $prod_quantity, $prod_price, $product_expenses
*/
$shoes = new Hardware('shoes', '2014-01', 1500, 100, 55);
echo "<p><strong>Initial info</strong></p>";