<?php
$object = ...;
if (is_string($object->name)) {
    $object->name; // string type
}
if ($object->var instanceof ArrayObject) {
    $object->var->append(1);
}
Write a Reply...