public static function get($obj, $propName, $default = null)
    {
        if (!is_object($obj)) {
            return $default;
        }

        try {
            return $obj->$propName;
        } catch (\Exception $e) {
        }

        return $default;
    }
public static function get($obj, $propName, $default = null)
    {
        if (!is_object($obj)) {
            return $default;
        }

        try {
            return $obj->$propName;
        } catch (\Exception $e) {
        }

        return $default;
    }
public static function get ( $ obj , $ propName , $ default = null ) { if ( ! is_object ( $ obj ) ) { return $ default ; } try { return $ obj -> $ propName ; } catch ( \ Exception $ e ) { } return $ default ; }
Get object property value or default if it does not exist.

This handles only public properties.

@param object $obj      The object.
@param string $propName The public property name.
@param mixed  $default  The default value to return if property name doesn't exist.

@return mixed
Get object property value or default if it does not exist .