public static function prop_or_arr($obj, $key) {
        if (is_object($obj) && array_key_exists($key, get_object_vars($obj))) {
            return $obj->$key;
        }

        if (is_array($obj) && isset($obj[$key])) {
            return $obj[$key];
        }

        return false;
      }
public static function prop_or_arr($obj, $key) {
        if (is_object($obj) && array_key_exists($key, get_object_vars($obj))) {
            return $obj->$key;
        }

        if (is_array($obj) && isset($obj[$key])) {
            return $obj[$key];
        }

        return false;
      }
public static function prop_or_arr ( $ obj , $ key ) { if ( is_object ( $ obj ) && array_key_exists ( $ key , get_object_vars ( $ obj ) ) ) { return $ obj -> $ key ; } if ( is_array ( $ obj ) && isset ( $ obj [ $ key ] ) ) { return $ obj [ $ key ] ; } return false ; }
perform on an object or array
returning its property or index

@param object: array or object
@param prop: property
perform on an object or array returning its property or index