当前位置: 首页>>代码示例>>PHP>>正文


PHP SplDoublyLinkedList::current方法代码示例

本文整理汇总了PHP中SplDoublyLinkedList::current方法的典型用法代码示例。如果您正苦于以下问题:PHP SplDoublyLinkedList::current方法的具体用法?PHP SplDoublyLinkedList::current怎么用?PHP SplDoublyLinkedList::current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SplDoublyLinkedList的用法示例。


在下文中一共展示了SplDoublyLinkedList::current方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: nextTick

 private function nextTick()
 {
     $this->future->rewind();
     while ($this->future->valid() && ($task = $this->future->current())) {
         if (!$task->isBlocked() || !$task->isStarted()) {
             $this->tick->enqueue($task);
             $this->future->offsetUnset($this->future->key());
             $this->future->prev();
         }
         $this->future->next();
     }
 }
开发者ID:crystalplanet,项目名称:redshift,代码行数:12,代码来源:EventLoop.php

示例2: retrieveMaintenanceTaskEntry

 /**
  * Retrieve the maintenance task entry, from unique identfier
  * @param $maintenanceTaskEntryIdentifier   Identifier to locate entry
  * @return mixed|null                       Returns the maintenance task entry or null on error
  * @throws InvalidArgumentException         if the provided argument is not set or of correct type
  */
 public function retrieveMaintenanceTaskEntry($maintenanceTaskEntryIdentifier)
 {
     if (!isset($maintenanceTaskEntryIdentifier)) {
         //argument check
         throw new InvalidArgumentException("Missing Argument");
     } else {
         if (!is_numeric($maintenanceTaskEntryIdentifier)) {
             //argument check
             throw new InvalidArgumentException("maintenanceTaskEntryIdentifier is not a number");
         }
     }
     if ($this->maintenanceTaskList->isEmpty()) {
         //if list is empty, unable to return entry
         return null;
     } else {
         $this->maintenanceTaskList->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
         //set iteration FIFO
         for ($this->maintenanceTaskList->rewind(); $this->maintenanceTaskList->valid(); $this->maintenanceTaskList->next()) {
             if ($this->maintenanceTaskList->current()->getTaskEntryIdentifier() == $maintenanceTaskEntryIdentifier) {
                 //if entry identifier matches supplied identifier
                 return $this->maintenanceTaskList->current();
             }
             //return the matching entry
         }
     }
     return null;
     //entry with given identifier not found
 }
开发者ID:matthewstyler,项目名称:php-automobile-maintenence-tracker,代码行数:34,代码来源:MaintenanceTracker.php

示例3: dispatch

 /**
  * Dispatch
  * @return mixed
  */
 private function dispatch()
 {
     // for each route
     for (; $this->routes->valid(); $this->routes->next()) {
         $route = $this->routes->current();
         // if method is OK
         if (strtoupper($route['method']) === $this->method || $route['method'] === '*') {
             $regex = $this->normalizeRegex($route['path']);
             // if path is OK
             if (preg_match("@^{$regex}@", $this->uri, $matches)) {
                 $callback = $route['callback'];
                 $req = new \ArrayObject();
                 $req->params = (object) $matches;
                 $req->uri = $this->uri;
                 $req->path = $this->path;
                 $req->query = $this->query;
                 if ($this->method !== 'GET') {
                     if (!isset($data)) {
                         parse_str(file_get_contents("php://input"), $data);
                     }
                     $req->body = $data;
                 }
                 $that = $this;
                 $next = function () use($that) {
                     $that->routes->next();
                     $that->dispatch();
                 };
                 return $callback($req, $next);
             }
         }
     }
 }
开发者ID:zorca,项目名称:parvula,代码行数:36,代码来源:Router.php

示例4: __construct

 public function __construct()
 {
     $listLink = new SplDoublyLinkedList();
     $listLink->push('Albin');
     $listLink->push('to');
     $listLink->push('the');
     $listLink->push('interface;');
     $listLink->push('not');
     $listLink->push('the');
     $listLink->push('Sandi');
     echo "<strong>Free good advice :</strong><br />";
     $listLink->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
     for ($listLink->rewind(); $listLink->valid(); $listLink->next()) {
         echo $listLink->current() . " ";
     }
     echo "<br /><br /><strong>Yoda talk: last in first out:</strong><br />";
     $listLink->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);
     for ($listLink->rewind(); $listLink->valid(); $listLink->next()) {
         echo $listLink->current() . " ";
     }
 }
开发者ID:asandi01,项目名称:phpLitsTest,代码行数:21,代码来源:LinkedListBuiltIn.php

示例5: unserialize

$listPasilloSession = unserialize($_SESSION['listPasillo']);
$listPasilloTP = $listPasilloSession->offsetGet($_GET['pas']);
$listPa = $listPasilloTP->getTypeProducts();
$listProducts2 = $listPa->offsetGet($_GET['type']);
$listProducts3 = $listProducts2->getListProduct();
$listProductsTP2 = $listProducts3->offsetGet($_GET['prods']);
$listProducts = $listProductsTP2->getListProducts();
$listPila = new SplDoublyLinkedList();
$listProducts->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($listProducts->rewind(); $listProducts->valid(); $listProducts->next()) {
    $data = $listProducts->current();
    $listPila->push($data);
}
$listPila->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($listPila->rewind(); $listPila->valid(); $listPila->next()) {
    $dataPila = $listPila->current();
    ?>
                                    <tr>
                                        <td class="center"><?php 
    echo $dataPila->getIdProduct();
    ?>
</td>
                                        <td><?php 
    echo $dataPila->getProduct();
    ?>
</td>
                                        <td class="center">
                                            <?php 
    if ($_SESSION['admin'] == 1) {
        ?>
 
开发者ID:asandi01,项目名称:phpLitsTest,代码行数:30,代码来源:product.php

示例6: SplDoublyLinkedList

<?php

$a = new SplDoublyLinkedList();
$a->push(1);
$a->push(2);
$a->push(3);
$a->rewind();
while ($a->valid()) {
    var_dump($a->current(), $a->next());
}
?>
===DONE===
开发者ID:gleamingthecube,项目名称:php,代码行数:12,代码来源:ext_spl_tests_dllist_007.php

示例7: SplFixedArray

$dlanguages->push(['C++', 'computing', 99.59999999999999]);
$dlanguages->push(['C', 'computing', 99.90000000000001]);
$dlanguages->push(['Java', 'application', 100]);
$dlanguages->push(['C#', 'application', 91.8]);
$dlanguages->push(['Python', 'application', 95.8]);
$dlanguages->push(['PHP', 'web', 84.5]);
$dlanguages->push(['Perl', 'web', 66.90000000000001]);
$dlanguages->push(['R', 'computing', 84.7]);
$dlanguages->push(['Ruby', 'web', 75.3]);
$dlanguages->push(['VB.NET', 'application', 63.4]);
$dlanguages->push(['Javascript', 'web', 83]);
$dlanguages->push(['Matlab', 'computing', 72.40000000000001]);
echo "\nDOUBLY LINK LIST LOOP: FIFO\n";
$dlanguages->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($dlanguages->rewind(); $dlanguages->valid(); $dlanguages->next()) {
    echo $dlanguages->current()[0] . "\n";
    echo $dlanguages->current()[1] . "\n";
    echo $dlanguages->current()[2] . "\n";
}
/* FIXED ARRAY  */
$fdatabases = new SplFixedArray(11);
$fdatabases[0] = ['Databases', 'Type', 'Size', 'Ranking'];
$fdatabases[1] = ['Oracle', 'Proprietary', 'Server', 1497.55];
$fdatabases[2] = ['SQL Server', 'Proprietary', 'Server', 1123.16];
$fdatabases[3] = ['PostgreSQL', 'Open-Source', 'Server', 280.09];
$fdatabases[4] = ['MySQL', 'Open-Source', 'Server', 1298.54];
$fdatabases[5] = ['DB2', 'Proprietary', 'Server', 196.13];
$fdatabases[6] = ['SQLite', 'Open-Source', 'File', 100.85];
$fdatabases[7] = ['MS Access', 'Proprietary', 'File', 140.21];
$fdatabases[8] = ['SAP Sybase', 'Proprietary', 'Server', 81.47];
$fdatabases[9] = ['Teradata', 'Proprietary', 'Server', 75.72];
开发者ID:ParfaitG,项目名称:DATA_STRUCTURES,代码行数:31,代码来源:DataStructures.php

示例8: key

 /**
  * (PHP 5 >= 5.1.0)
  * Return the key of the current element
  *
  * @link http://php.net/manual/en/iterator.key.php
  * @return integer 0 on failure.
  */
 public function key()
 {
     $currentRecord = $this->storage->current();
     return $currentRecord['uid'];
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:12,代码来源:AbstractRecordCollection.php

示例9: changeAvatar

print "<a style = \"float:right\" href=\"logout.php\">Logout    </a><br>";
print "<a href = \"javascript: changeAvatar('userExtenPanel');\"><img id = \"userAvatar\" class = \"userAvatar\" src = \"/picsUploads/" . $avatar . "\"></a><br>";
print "<a href = \"javascript: changeAvatar('userExtenPanel');\"> Choose Avatar</a><br>";
print "</div>";
print "<div id = \"userTrvHistPanel\" class = \"userTrvHistPanel\">";
if (isset($_SESSION['loginId']) && $_SESSION['loginId'] !== "admin") {
    print "Travel History\t\t<a href = \"javascript: updateUserInfo('clearHist');\">Clear</a>";
    if (isset($travelHistList)) {
        //prints the labels for the travel history table
        print "<table border='0px'>";
        print "<tr>";
        print "<td style= 'color:#CC0000; font-weight:bold'>Departing Airport\t\t\t\t\t\t\t</td>";
        print "<td style= 'color:#CC0000; font-weight:bold'>Arrival Airport\t\t\t\t\t\t\t\t</td>";
        print "<td style= 'color:#CC0000; font-weight:bold'>Date Traveled  \t</td>";
        print "<td style= 'color:#CC0000; font-weight:bold'>Leased Model\t\t\t\t\t\t\t</td>";
        print "</tr>";
        for ($travelHistList->rewind(); $travelHistList->valid(); $travelHistList->next()) {
            print "<tr><td>" . $travelHistList->current()->depart . "</td><td>" . $travelHistList->current()->arrive . "</td><td>" . $travelHistList->current()->travelDate . "</td><td>" . $travelHistList->current()->leasedModel . "</td></tr>";
        }
        print "</table></font>";
    } else {
        print "Error loading travel history table";
    }
}
print "</div>";
print "</div>";
print "</font>";
print "</div>";
print "<script>saveTrvHist();</script>";
print "<label id = \"xmlRespondFeedback\" style = \"visibility:hidden;\"></label>";
include "tailHTML.html";
开发者ID:ssekar1,项目名称:Planes-for-Hire,代码行数:31,代码来源:userprofile.php

示例10: SplDoublyLinkedList

<?php

$dll = new SplDoublyLinkedList();
$dll->push(1);
$dll->push(2);
$dll->push(3);
$dll->push(4);
$dll->rewind();
echo $dll->current() . "\n";
$dll->next();
$dll->next();
echo $dll->current() . "\n";
?>
===DONE===
开发者ID:gleamingthecube,项目名称:php,代码行数:14,代码来源:ext_spl_tests_dllist_memleak.php

示例11: SplDoublyLinkedList

<?php

$list = new SplDoublyLinkedList();
var_dump($list->current());
开发者ID:badlamer,项目名称:hhvm,代码行数:4,代码来源:SplDoublyLinkedList_current_empty.php

示例12: SplDoublyLinkedList

<?php

$list = new SplDoublyLinkedList();
$list->push('a');
$list->add(1, 'e');
$list->push('b');
$list->push('c');
$list->push('d');
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
$list->rewind();
while ($list->valid()) {
    echo $list->current(), "\n";
    $list->next();
}
开发者ID:shambhukumar,项目名称:code,代码行数:14,代码来源:SplDoublyLinkedList.php

示例13: SplDoublyLinkedList

<?php

$dll = new SplDoublyLinkedList();
$dll->push('foo');
$dll->push('bar');
echo $dll->pop(), PHP_EOL;
$dll->rewind();
echo $dll->current(), PHP_EOL;
$dll->next();
echo $dll->current(), PHP_EOL;
开发者ID:badlamer,项目名称:hhvm,代码行数:10,代码来源:SplDoublyLinkedList_pop.php

示例14:

 $airport = $row['airport'];
 if ($planeWaitList != NULL) {
     for ($planeWaitList->rewind(); $planeWaitList->valid(); $planeWaitList->next()) {
         $memberWaitList = $planeWaitList->current();
         $plane = $memberWaitList->offsetGet(0);
         //we're only interested in the first element of the list, since the first element of the memberWaitList is the model of the plane
         for ($memberWaitList->rewind(); $memberWaitList->valid(); $memberWaitList->next()) {
             $member = $memberWaitList->current();
             $positionInLine = $memberWaitList->key();
             if ($member == $_SESSION['loginId']) {
                 preg_match('/^[^,]*/', $airport, $matches);
                 // put the * back before the /
                 if ($matches) {
                     $elemExist = 0;
                     for ($tempBfr->rewind(); $tempBfr->valid(); $tempBfr->next()) {
                         if ($tempBfr->current() == "<tr><td>" . $positionInLine . "</td><td>" . $plane . "</td><td>" . $matches[0] . "</td></tr>") {
                             $elemExist = 1;
                         }
                     }
                     if (!$elemExist) {
                         $tempBfr->push("<tr><td>" . $positionInLine . "</td><td>" . $plane . "</td><td>" . $matches[0] . "</td></tr>");
                     }
                 } else {
                     $elemExist = 0;
                     for ($tempBfr->rewind(); $tempBfr->valid(); $tempBfr->next()) {
                         if ($tempBfr->current() == "<tr><td>" . $positionInLine . "</td><td>" . $plane . "</td><td>" . $airport . "</td></tr>") {
                             $elemExist = 1;
                         }
                     }
                     if (!$elemExist) {
                         $tempBfr->push("<tr><td>" . $positionInLine . "</td><td>" . $plane . "</td><td>" . $airport . "</td></tr>");
开发者ID:ssekar1,项目名称:Planes-for-Hire,代码行数:31,代码来源:waitingList.php

示例15: SplDoublyLinkedList

<?php

$list = new SplDoublyLinkedList();
$list->push('o');
$list->push('o');
$list->push('f');
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);
$list->rewind();
while ($tmp = $list->current()) {
    echo $tmp;
    $list->next();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:12,代码来源:SplDoublyLinkedList_lifoMode.php


注:本文中的SplDoublyLinkedList::current方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。