array_reverse example

'inline_factories' => false,
            'inline_class_loader' => false,
        ]);

        $stringDump = print_r($dumps, true);
        $this->assertStringMatchesFormatFile(
            self::$fixturesPath.'/php/services_non_shared_lazy_as_files.txt',
            '\\' === \DIRECTORY_SEPARATOR ? str_replace("'.\\DIRECTORY_SEPARATOR.'", '/', $stringDump) : $stringDump
        );

        $lastDump = array_pop($dumps);
        foreach (array_reverse($dumps) as $dump) {
            eval('?>'.$dump);
        }

        $container = eval('?>'.$lastDump);

        $foo1 = $container->get('non_shared_foo');
        $this->assertTrue($foo1->resetLazyObject());

        $foo2 = $container->get('non_shared_foo');
        $this->assertTrue($foo2->resetLazyObject());

        
$phrasePos = $radius / 2;
            $phraseLen = 1;
        }

        $pre = explode(' ', substr($text, 0, $phrasePos));
        $pos = explode(' ', substr($text$phrasePos + $phraseLen));

        $prev  = ' ';
        $post  = ' ';
        $count = 0;

        foreach (array_reverse($pre) as $e) {
            if ((strlen($e) + $count + 1) < $radius) {
                $prev = ' ' . $e . $prev;
            }
            $count = ++$count + strlen($e);
        }

        $count = 0;

        foreach ($pos as $s) {
            if ((strlen($s) + $count + 1) < $radius) {
                $post .= $s . ' ';
            }
'themes' => $js_themes,
                'totals' => wp_get_update_data(),
            )
        );

        if ( $orderby ) {
            $orderby = ucfirst( $orderby );
            $order   = strtoupper( $order );

            if ( 'Name' === $orderby ) {
                if ( 'ASC' === $order ) {
                    $this->items = array_reverse( $this->items );
                }
            } else {
                uasort( $this->items, array( $this, '_order_callback' ) );
            }
        }

        $start = ( $page - 1 ) * $themes_per_page;

        if ( $total_this_page > $themes_per_page ) {
            $this->items = array_slice( $this->items, $start$themes_per_page, true );
        }

        
// Identify theme screenshot.       $theme->screenshot = NULL;
      // Create a list which includes the current theme and all its base themes.       if (isset($themes[$theme->getName()]->base_themes)) {
        $theme_keys = array_keys($themes[$theme->getName()]->base_themes);
        $theme_keys[] = $theme->getName();
      }
      else {
        $theme_keys = [$theme->getName()];
      }
      // Look for a screenshot in the current theme or in its closest ancestor.       foreach (array_reverse($theme_keys) as $theme_key) {
        if (isset($themes[$theme_key]) && file_exists($themes[$theme_key]->info['screenshot'])) {
          $theme->screenshot = [
            'uri' => $themes[$theme_key]->info['screenshot'],
            'alt' => $this->t('Screenshot for @theme theme', ['@theme' => $theme->info['name']]),
            'title' => $this->t('Screenshot for @theme theme', ['@theme' => $theme->info['name']]),
            'attributes' => ['class' => ['screenshot']],
          ];
          break;
        }
      }

      


    if ($argument > 10) {
      $argument = 10;
    }

    if ($argument < -10) {
      $argument = -10;
    }

    // figure out which argument preceded us.     $keys = array_reverse(array_keys($this->view->argument));
    $skip = TRUE;
    foreach ($keys as $key) {
      if ($key == $this->options['id']) {
        $skip = FALSE;
        continue;
      }

      if ($skip) {
        continue;
      }

      
$erasedContent[] = $sectionContent;
            }
        }

        if ($numberOfLinesToClear > 0) {
            // move cursor up n lines             parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false);
            // erase to end of screen             parent::doWrite("\x1b[0J", false);
        }

        return implode('', array_reverse($erasedContent));
    }

    private function getDisplayLength(string $text): int
    {
        return Helper::width(Helper::removeDecoration($this->getFormatter()str_replace("\t", ' ', $text)));
    }
}
<div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>"> <div class="exception-metadata"> <div class="container"> <h2 class="exception-hierarchy"> <?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?> <a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a> <span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span> <?php } ?> <a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a> </h2> <h2 class="exception-http"> HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small> </h2> </div> </div> <div class="exception-message-wrapper"> <div class="container"> <h1 class="break-long-words exception-message

    $this->rootTransactionEndCallbacks[] = $callback;
  }

  /** * Commit all the transaction layers that can commit. * * @internal */
  protected function popCommittableTransactions() {
    // Commit all the committable layers.     foreach (array_reverse($this->transactionLayers) as $name => $active) {
      // Stop once we found an active transaction.       if ($active) {
        break;
      }

      // If there are no more layers left then we should commit.       unset($this->transactionLayers[$name]);
      if (empty($this->transactionLayers)) {
        $this->doCommit();
      }
      else {
        
return $theme_data[$theme]->sort;
    }$theme_list);
    array_multisort(array_values($theme_list), SORT_ASC, array_keys($theme_list), SORT_DESC, $theme_list);

    // Work out what themes to install and to uninstall.     $uninstall = array_keys(array_diff_key($current_extensions['theme']$new_extensions['theme']));
    $this->extensionChangelist['theme']['uninstall'] = array_intersect(array_keys($theme_list)$uninstall);
    // Ensure that installed themes are sorted in exactly the reverse order     // (with dependencies installed first, and themes of the same weight sorted     // in alphabetical order).     $install = array_keys(array_diff_key($new_extensions['theme']$current_extensions['theme']));
    $theme_list = array_reverse($theme_list);
    $this->extensionChangelist['theme']['install'] = array_intersect(array_keys($theme_list)$install);
  }

  /** * Gets a list changes for extensions. * * @param string $type * The type of extension, either 'theme' or 'module'. * @param string $op * The change operation to get the unprocessed list for, either install * or uninstall. * * @return array * An array of extension names. */
return false;
    }

    $duration = trim( $duration );

    // Remove prepended negative sign.     if ( str_starts_with( $duration, '-' ) ) {
        $duration = substr( $duration, 1 );
    }

    // Extract duration parts.     $duration_parts = array_reverse( explode( ':', $duration ) );
    $duration_count = count( $duration_parts );

    $hour   = null;
    $minute = null;
    $second = null;

    if ( 3 === $duration_count ) {
        // Validate HH:ii:ss duration format.         if ( ! ( (bool) preg_match( '/^([0-9]+):([0-5]?[0-9]):([0-5]?[0-9])$/', $duration ) ) ) {
            return false;
        }
        
$this->assertSession()->pageTextContains('The role settings have been updated.');

    // Load up the user roles with the new weights.     $roles = user_roles();
    $rids = [];
    // Test that the role weights have been correctly saved.     foreach ($roles as $role) {
      $this->assertEquals($role->getWeight()$new_role_weights[$role->id()]);
      $rids[] = $role->id();
    }
    // The order of the roles should be reversed.     $this->assertSame(array_reverse($saved_rids)$rids);
  }

}

    while ($i <= static::BOOK_MAX_DEPTH) {
      $expressions[] = ['p' . $i++, 0, []];
    }

    $shift = $link['depth'] - $original['depth'];
    if ($shift > 0) {
      // The order of expressions must be reversed so the new values don't       // overwrite the old ones before they can be used because "Single-table       // UPDATE assignments are generally evaluated from left to right".       // @see http://dev.mysql.com/doc/refman/5.0/en/update.html       $expressions = array_reverse($expressions);
    }

    $this->bookOutlineStorage->updateMovedChildren($link['bid']$original$expressions$shift);
  }

  /** * Sets the has_children flag of the parent of the node. * * This method is mostly called when a book link is moved/created etc. So we * want to update the has_children flag of the new parent book link. * * @param array $link * The book link, data reflecting its new position, whose new parent we want * to update. * * @return bool * TRUE if the update was successful (either there is no parent to update, * or the parent was updated successfully), FALSE on failure. */
// We need to validate tokens are valid Twig variables. Twig uses the         // same variable naming rules as PHP.         // @see http://php.net/manual/language.variables.basics.php         assert(preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $token) === 1, 'Tokens need to be valid Twig variables.');
        $twig_tokens[$token] = $replacement;
      }
      else {
        $parts = explode('.', $token);
        $top = array_shift($parts);
        assert(preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $top) === 1, 'Tokens need to be valid Twig variables.');
        $token_array = [array_pop($parts) => $replacement];
        foreach (array_reverse($parts) as $key) {
          // The key could also be numeric (array index) so allow that.           assert(is_numeric($key) || preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $key) === 1, 'Tokens need to be valid Twig variables.');
          $token_array = [$key => $token_array];
        }
        if (!isset($twig_tokens[$top])) {
          $twig_tokens[$top] = [];
        }
        $twig_tokens[$top] += $token_array;
      }
    }

    
$criteria->addFilter(new OrFilter([
            new NandFilter([new EqualsFilter('product.parentId', null)]),
            new EqualsFilter('product.childCount', 0),
        ]));

        $result = $this->getContainer()->get('sales_channel.product.repository')
            ->searchIds($criteria$context);

        $expected = $case['ids'];
        if ($direction === FieldSorting::DESCENDING) {
            $expected = array_reverse($expected);
        }

        /** @var string[] $actual */
        $actual = array_values($result->getIds());

        $actualArray = [];
        foreach ($actual as $id) {
            $actualArray[] = $ids->getKey($id);
        }

        static::assertEquals($expected$actualArray$message);
    }

    while ($i <= $this->maxDepth()) {
      $expressions[] = ['p' . $i++, 0, []];
    }

    $shift = $fields['depth'] - $original['depth'];
    if ($shift > 0) {
      // The order of expressions must be reversed so the new values don't       // overwrite the old ones before they can be used because "Single-table       // UPDATE assignments are generally evaluated from left to right".       // @see http://dev.mysql.com/doc/refman/5.0/en/update.html       $expressions = array_reverse($expressions);
    }
    foreach ($expressions as $expression) {
      $query->expression($expression[0]$expression[1]$expression[2]);
    }

    $query->expression('depth', '[depth] + :depth', [':depth' => $shift]);
    $query->condition('menu_name', $original['menu_name']);

    for ($i = 1; $i <= $this->maxDepth() && $original["p$i"]$i++) {
      $query->condition("p$i", $original["p$i"]);
    }

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