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
}

评论

- 위키
Copyright © 2011-2026 iteam. Current version is 2.148.3. UTC+08:00, 2026-01-14 00:40
浙ICP备14020137号-1 $방문자$