is_object example

function __construct($lex$compiler) {
        // set instance object         self::instance($this);
        $this->lex = $lex;
        $this->smarty = $compiler->smarty;
        $this->compiler = $compiler;
    }
    public static function Dinstance($new_instance = null)
    {
        static $instance = null;
        if (isset($new_instance) && is_object($new_instance))
            $instance = $new_instance;
        return $instance;
    }

    private function parse_bool($str) {
        if (in_array(strtolower($str) ,array('on','yes','true'))) {
            $res = true;
        } else {
            $res = false;
        }
        return $res;
    }
/** * Formats data into a single line to be written by the writer. * * @param array $event event data * @return string formatted line to write to the log */
    public function format($event)
    {
        $output = $this->_format;

        foreach ($event as $name => $value) {
            if ((is_object($value) && !method_exists($value,'__toString'))
                || is_array($value)
            ) {
                $value = gettype($value);
            }

            $output = str_replace("%$name%", $value$output);
        }

        return $output;
    }
}
$new_args = array_merge($new_args$mixed);
                                } else {
                                    $new_args[$key] = $mixed;
                                }
                            }
                            if (!$this->smarty->registered_plugins[$plugin_type][$tag][1]) {
                                $this->tag_nocache = true;
                            }
                            $function = $this->smarty->registered_plugins[$plugin_type][$tag][0];
                            if (!is_array($function)) {
                                return $function($new_args$this);
                            } else if (is_object($function[0])) {
                                return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->{$function[1]}($new_args$this);
                            } else {
                                return call_user_func_array($function, array($new_args$this));
                            }
                        }
                        // compile registered function or block function                         if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {
                            return $this->callTagCompiler('private_registered_' . $plugin_type$args$parameter$tag);
                        }
                    }
                }
                
public function load(mixed $resource, string $type = null): RouteCollection
    {
        if (!preg_match('/^[^\:]+(?:::(?:[^\:]+))?$/', $resource)) {
            throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the %s route loader: use the format "object_id::method" or "object_id" if your object class has an "__invoke" method.', $resource, \is_string($type) ? '"'.$type.'"' : 'object'));
        }

        $parts = explode('::', $resource);
        $method = $parts[1] ?? '__invoke';

        $loaderObject = $this->getObject($parts[0]);

        if (!\is_object($loaderObject)) {
            throw new \TypeError(sprintf('"%s:getObject()" must return an object: "%s" returned.', static::classget_debug_type($loaderObject)));
        }

        if (!\is_callable([$loaderObject$method])) {
            throw new \BadMethodCallException(sprintf('Method "%s" not found on "%s" when importing routing resource "%s".', $methodget_debug_type($loaderObject)$resource));
        }

        $routeCollection = $loaderObject->$method($this$this->env);

        if (!$routeCollection instanceof RouteCollection) {
            $type = get_debug_type($routeCollection);

            

    public function makeId($callback, array $args = array())
    {
        if (!is_callable($callback, true, $name)) {
            Zend_Cache::throwException('Invalid callback');
        }

        // functions, methods and classnames are case-insensitive         $name = strtolower($name);

        // generate a unique id for object callbacks         if (is_object($callback)) { // Closures & __invoke             $object = $callback;
        } elseif (isset($callback[0])) { // array($object, 'method')             $object = $callback[0];
        }
        if (isset($object)) {
            try {
                $tmp = @serialize($callback);
            } catch (Exception $e) {
                Zend_Cache::throwException($e->getMessage());
            }
            if (!$tmp) {
                
$modifier_types = array(1, 2, 3, 4, 5, 6);
            }
            foreach ($modifier_types as $type) {
                switch ($type) {
                    case 1:
                        // registered modifier                         if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) {
                            $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];
                            if (!is_array($function)) {
                                $output = "{$function}({$params})";
                            } else {
                                if (is_object($function[0])) {
                                    $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')';
                                } else {
                                    $output = $function[0] . '::' . $function[1] . '(' . $params . ')';
                                }
                            }
                            $compiler->known_modifier_type[$modifier] = $type;
                            break 2;
                        }
                        break;
                    case 2:
                        // registered modifier compiler

        ];
    }

    /** * @param string|int|float|bool|null $var * * @return string|int|float|bool|null */
    private function validateType($var)
    {
        if (\is_object($var) && \method_exists($var, '__toString')) {
            return $var->__toString();
        }

        if (!\is_scalar($var) && $var !== null) {
            throw new \InvalidArgumentException(
                'Non-scalar value given to intval/floatval/strval/boolval filter'
            );
        }

        return $var;
    }
}

function delete_usermeta( $user_id$meta_key$meta_value = '' ) {
    _deprecated_function( __FUNCTION__, '3.0.0', 'delete_user_meta()' );
    global $wpdb;
    if ( !is_numeric( $user_id ) )
        return false;
    $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);

    if ( is_array($meta_value) || is_object($meta_value) )
        $meta_value = serialize($meta_value);
    $meta_value = trim( $meta_value );

    $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id$meta_key) );

    if ( $cur && $cur->umeta_id )
        do_action( 'delete_usermeta', $cur->umeta_id, $user_id$meta_key$meta_value );

    if ( ! empty($meta_value) )
        $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id$meta_key$meta_value) );
    else
        
new \DateTimeZone('UTC')
                ));
            }

            return $value->format('Y-m-d H:i:s');
        }

        if ($value instanceof \UnitEnum) {
            return $value->name;
        }

        if (\is_object($value)) {
            if (($format & self::OBJECT_TO_STRING) && $value instanceof \Stringable) {
                return $value->__toString();
            }

            return 'object';
        }

        if (\is_array($value)) {
            return 'array';
        }

        
$fields = (array) $constraint->fields;

        if (0 === \count($fields)) {
            throw new ConstraintDefinitionException('At least one field has to be specified.');
        }

        if (null === $entity) {
            return;
        }

        if (!\is_object($entity)) {
            throw new UnexpectedValueException($entity, 'object');
        }

        if ($constraint->em) {
            $em = $this->registry->getManager($constraint->em);

            if (!$em) {
                throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em));
            }
        } else {
            $em = $this->registry->getManagerForClass($entity::class);

            

    public function getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
    {
        if (isset($varname)) {
            $_var = $this->getVariable($varname$_ptr$search_parents, false);
            if (is_object($_var)) {
                return $_var->value;
            } else {
                return null;
            }
        } else {
            $_result = array();
            if ($_ptr === null) {
                $_ptr = $this;
            } while ($_ptr !== null) {
                foreach ($_ptr->tpl_vars AS $key => $var) {
                    if (!array_key_exists($key$_result)) {
                        
throw new \RuntimeException('Unknown EventDataType: ' . $dataType['type']);
        }
    }

    /** * @param object|array<string, mixed> $object * * @return mixed */
    private function getProperty(string $propertyName$object)
    {
        if (\is_object($object)) {
            $getter = 'get' . ucfirst($propertyName);
            if (method_exists($object$getter)) {
                return $object->$getter(); /* @phpstan-ignore-line */
            }

            $isser = 'is' . ucfirst($propertyName);
            if (method_exists($object$isser)) {
                return $object->$isser(); /* @phpstan-ignore-line */
            }
        }

        
return false;
        }

        if ( empty( $group ) ) {
            $group = 'default';
        }

        if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
            $key = $this->blog_prefix . $key;
        }

        if ( is_object( $data ) ) {
            $data = clone $data;
        }

        $this->cache[ $group ][ $key ] = $data;
        return true;
    }

    /** * Sets multiple values to the cache in one call. * * @since 6.0.0 * * @param array $data Array of key and value to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is always true. */

        $hasherKey = null;

        if ($user instanceof PasswordHasherAwareInterface && null !== $hasherName = $user->getPasswordHasherName()) {
            if (!\array_key_exists($hasherName$this->passwordHashers)) {
                throw new \RuntimeException(sprintf('The password hasher "%s" was not configured.', $hasherName));
            }

            $hasherKey = $hasherName;
        } else {
            foreach ($this->passwordHashers as $class => $hasher) {
                if ((\is_object($user) && $user instanceof $class) || (!\is_object($user) && (is_subclass_of($user$class) || $user == $class))) {
                    $hasherKey = $class;
                    break;
                }
            }
        }

        if (null === $hasherKey) {
            throw new \RuntimeException(sprintf('No password hasher has been configured for account "%s".', \is_object($user) ? get_debug_type($user) : $user));
        }

        if (!$this->passwordHashers[$hasherKey] instanceof PasswordHasherInterface) {
            

  #[\ReturnTypeWillChange]   public function count($refresh = FALSE) {
    if ($this->skipCount) {
      return MigrateSourceInterface::NOT_COUNTABLE;
    }

    // Return the cached count if we are caching counts and a refresh is not     // requested.     if ($this->cacheCounts && !$refresh) {
      $cache_object = $this->getCache()->get($this->cacheKey, 'cache');
      if (is_object($cache_object)) {
        return $cache_object->data;
      }
    }
    $count = $this->doCount();
    // Update the cache if we are caching counts.     if ($this->cacheCounts) {
      $this->getCache()->set($this->cacheKey, $count);
    }
    return $count;
  }

  
Home | Imprint | This part of the site doesn't use cookies.