<?php
echo "let's create a date object", PHP_EOL;
$date = date_create();
echo "it has some public properties!!", PHP_EOL;
foreach ($date as $key => $value) {
echo $key, ' => ', $value, PHP_EOL;
}
echo "let's change one of them.. because it is public right", PHP_EOL;
$date->date = 'foo';
echo "It works!! Hourra ....", PHP_EOL;
echo $date->date, PHP_EOL;
echo "Or it does not ...", PHP_EOL;
foreach ($date as $key => $value) {
echo $key, ' ', $value, PHP_EOL;
}
echo "Is the public properties really all that public .. And don't get me started on HHVM ???";