Глава 6: вычитка главы

This commit is contained in:
Igor Simdyanov
2022-05-06 13:14:01 +03:00
parent e8332724b2
commit 73a64a6c6c
3 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,9 @@
<?php
require 'point.php';
$point = new Point;
$point->x = 5;
$point->y = 3;
echo $point->x; // 5

View File

@ -1,8 +1,11 @@
<?php
require 'point.php';
$point = new Point;
$point->x = 3;
$point->y = 7;
// Уничтожение объекта
unset($point);
echo $point->x; // PHP Warning: Undefined variable $point

View File

@ -1,5 +1,7 @@
<?php
require 'point.php';
$point = new Point();
$point = 3;
echo $point; // 3