SplQueue::__construct()函数是PHP中的内置函数, 用于构建使用双链表实现的队列。php
语法以下:html
void SplQueue::__construct(void)
参数:此函数不接受任何参数。后端
返回值:此函数不返回任何值。app
下面的程序说明了SplQueue::__ construct()PHP中的函数:函数
程序1:.net
<?php // Create a new empty queue $q = new SplQueue(); $q [] = 1; $q [] = 2; $q [] = 3; // Print the queue elements echo $q [0] . "n" ; echo $q [1] . "n" ; echo $q [2] . "n" ; ?>
输出以下:code
1 2 3
程式2:htm
<?php // Create some fixed size array $gfg = new SplQueue(); $gfg [] = 1; $gfg [] = 5; $gfg [] = 1; $gfg [] = 11; $gfg [] = 15; $gfg [] = 17; foreach ( $gfg as $elem ) { echo $elem . "n" ; } ?>
输出以下:队列
1 5 1 11 15 17
参考: https://www.php.net/manual/en...后端开发
更多后端开发相关内容请参考:lsbin - IT开发技术:https://www.lsbin.com/
查看如下更多PHP相关的内容: