mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-03 16:43:03 +00:00
19 lines
249 B
PHP
19 lines
249 B
PHP
<?php
|
|
class Point {
|
|
private $x;
|
|
private $y;
|
|
|
|
public function getVariables() : array
|
|
{
|
|
return get_object_vars($this);
|
|
}
|
|
}
|
|
|
|
$point = new Point;
|
|
|
|
$point->z = 5;
|
|
|
|
echo '<pre>';
|
|
print_r($point->getVariables());
|
|
echo '</pre>';
|