xiaozi 2015-01-19 14:56:41

php中,赋值引发的死循环,因为数组内部指针被重置了。

php php
<?php

$arr = ['hello', 'world'];

while ($word = each($arr)) {
    var_dump($word['value']);
    $x = $arr; // here
}

评论

首页 - Wiki
Copyright © 2011-2025 iteam. Current version is 2.140.0. UTC+08:00, 2025-01-25 23:01
浙ICP备14020137号-1 $访客地图$