# 简要示例
```
<?php
$redis = new redis();
$redis->pconnect('127.0.0.1', 6379, 1);
for($i=0;$i<50;$i++) {
try {
$redis->LPUSH('click', rand(1000, 5000));
} catch (Exception $e) {
echo $e->getMessage();
}
}
while(true) {
try {
$value = $redis->LPOP('click');
if (!$value) {
break;
}
var_dump($value) . "\n";
} catch (Exception $e) {
echo $e->getMessage();
}
}
```
结果
![](https://box.kancloud.cn/a1a300056a8566eb82789494db3c4e96_580x802.png)