<?php
class Country {
function set_name($name) {
$this->name = $name;
}
}
$jurop = new Country;
$dutchieland = new Country;
$dutchieland->set_name('The Netherlands');
echo (int) $jurop, "\n";
echo (int) $dutchieland, "\n";
?>
In PHP 4 (int) $object results in:
- "0" when there are no properties set
- "1" when there are properties set
In PHP 5 (int) $object results in:
- "Object id #" + Object ID
- unless zend.ze1_compatibility_mode = 1