prev example



    /* * If a post has been saved since the latest revision (no revisioned fields * were changed), we may not have a "current" revision. Mark the latest * revision as "current". */
    if ( empty( $current_id ) ) {
        if ( $revisions[ $revision->ID ]['autosave'] ) {
            $revision = end( $revisions );
            while ( $revision['autosave'] ) {
                $revision = prev( $revisions );
            }
            $current_id = $revision['id'];
        } else {
            $current_id = $revision->ID;
        }
        $revisions[ $current_id ]['current'] = true;
    }

    // Now, grab the initial diff.     $compare_two_mode = is_numeric( $from );
    if ( ! $compare_two_mode ) {
        
return $this->slim->urlFor($currentEntry$params);
    }

    /** * @param array $params * * @return string */
    public function getPreviousUrl($params = [])
    {
        $entries = $this->entries;
        $currentEntry = prev($entries);

        return $this->slim->urlFor($currentEntry$params);
    }

    /** * @param array $params * * @return string */
    public function getCurrentUrl($params = [])
    {
        
end($from);
        end($to);

        do {
            $fromK = key($from);
            $toK   = key($to);

            if (null === $fromK || null === $toK || current($from) !== current($to)) {
                break;
            }

            prev($from);
            prev($to);

            $end = [$fromK => $from[$fromK]] + $end;
            unset($from[$fromK]$to[$toK]);
        } while (true);

        return [$from$to$start$end];
    }
}
            if ( $new_priority === $this->current_priority[ $index ] && ! $priority_existed ) {
                /* * ...and the new priority is the same as what $this->iterations thinks is the previous * priority, we need to move back to it. */

                if ( false === current( $iteration ) ) {
                    // If we've already moved off the end of the array, go back to the last element.                     $prev = end( $iteration );
                } else {
                    // Otherwise, just go back to the previous element.                     $prev = prev( $iteration );
                }

                if ( false === $prev ) {
                    // Start of the array. Reset, and go about our day.                     reset( $iteration );
                } elseif ( $new_priority !== $prev ) {
                    // Previous wasn't the same. Move forward again.                     next( $iteration );
                }
            }
        }

        
/** * Check whether the array contains more elements * @link https://php.net/manual/en/splfixedarray.valid.php * @return bool true if the array contains any more elements, false otherwise. */
    public function valid()
    {
        if (empty($this->internalArray)) {
            return false;
        }
        $result = next($this->internalArray) !== false;
        prev($this->internalArray);
        return $result;
    }

    /** * Do nothing. */
    public function __wakeup()
    {
        // NOP     }
}
$indent = strspn($line, " ");

            // line without the spaces             $line = trim($line);
            if (strlen($line) == 0) {
                continue;
            }

            if ($indent < $currentIndent) {
                // this level is done                 prev($lines);
                return $config;
            }

            if (!$inIndent) {
                $currentIndent = $indent;
                $inIndent      = true;
            }

            if (preg_match("/(?!-)([\w\-]+):\s*(.*)/", $line$m)) {
                // key: value                 if (strlen($m[2])) {
                    
Home | Imprint | This part of the site doesn't use cookies.