這篇文章主要介紹了PHP怎么使用Ds\Queue pop()函數(shù),具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
專注于為中小企業(yè)提供做網(wǎng)站、成都做網(wǎng)站服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)襄汾免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了成百上千企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
語法如下:
mixed public DsPriorityQueue::pop ( void )
參數(shù):該函數(shù)不接受任何參數(shù)。
返回值:此函數(shù)返回Queue頂部的現(xiàn)值。函數(shù)的返回類型是混合的, 并且取決于存儲(chǔ)在隊(duì)列中的值的類型。
例外注意:如果Queue為空, 則此函數(shù)引發(fā)UnderflowException。
下面的程序說明了DsQueue::pop()PHP中的功能:
程序1:
<?php // Declare new Queue $q = new DsQueue(); // Add elements to the Queue $q ->push( "One" ); $q ->push( "Two" ); $q ->push( "Three" ); echo "Initial Queue is: n" ; print_r( $q ); // Pop an element echo "nPopped element is: " ; print_r( $q ->pop()); echo "nnFinal Queue is: n" ; print_r( $q ); ?>
輸出如下:
Initial Queue is: DsQueue Object ( [0] => One [1] => Two [2] => Three ) Popped element is: One Final Queue is: DsQueue Object ( [0] => Two [1] => Three )
程式2:
<?php // Declare new Queue $q = new DsQueue(); // Add elements to the Queue $q ->push( "Geeks" ); $q ->push( "for" ); $q ->push( "Geeks" ); echo "Initial Queue is: n" ; print_r( $q ); // Pop an element echo "nPopped element is: " ; print_r( $q ->pop()); echo "nnFinal Queue is: n" ; print_r( $q ); ?>
輸出如下:
Initial Queue is: DsQueue Object ( [0] => Geeks [1] => for [2] => Geeks ) Popped element is: Geeks Final Queue is: DsQueue Object ( [0] => for [1] => Geeks )
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“PHP怎么使用Ds\Queue pop()函數(shù)”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來學(xué)習(xí)!
文章題目:PHP怎么使用Ds\Queuepop()函數(shù)
URL鏈接:http://aaarwkj.com/article20/igipco.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站制作、服務(wù)器托管、動(dòng)態(tài)網(wǎng)站、外貿(mào)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)