DsQueue::pop()PHP中的函数用于删除并返回出现在队列顶部的值。换句话说,它返回出现在队列前面的值并将其从队列中移除。语法如下:mixedpublicDsPriorityQueue::pop(void)参数:该函数不接受任何参数。返回值:此函数返回队列顶部的当前值。函数的返回类型是混合的,取决于存储在队列中的值的类型。异常说明:如果队列为空,此函数将抛出UnderflowException。下面的程序说明了DsQueue::pop()PHP中的功能:程序1:push("One");$q->push("Two");$q->push("Three");echo"初始队列是:n";print_r($q);//弹出一个元素echo"nPoppedelementis:";print_r($q->pop());echo"nnFinalQueueis:n";print_r($q);?>输入如下:InitialQueueis:DsQueueObject([0]=>One[1]=>Two[2]=>Three)弹出的元素是:OneFinalQueueis:DsQueueObject([0]=>Two[1]=>Three)程序式2:push("Geeks");$q->push("for");$q->push("Geeks");echo"初始队列是:n";print_r($q);//弹出一个元素echo"nPoppedelementis:";print_r($q->pop());echo"nnFinalQueueis:n";print_r($q);?>输出如下:InitialQueueis:DsQueueObject([0]=>Geeks[1]=>for[2]=>Geeks)Poppedelement是:GeeksFinalQueue是:DsQueueObject([0]=>for[1]=>Geeks)参考:http://php.net/manual/en/ds-q...更多PHP开发信息,请参考:lsbin-IT开发技术:https://www.lsbin.com/查看更多PHP相关内容如下:PHP错误处理方法详细介绍+实例:https://www.lsbin.com/3671。htmlPHP如何使用DsMapalloc()函数?:https://www.lsbin.com/3452.htmlPHP如何使用date_get_last_errors()函数?:https://www.lsbin.com/3203.html
