Are PHP variables declared inside a foreach loop destroyed and re-created at each iteration?

前端 未结 4 1674
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 15:12

If I declare a variable inside a foreach loop, such as:

foreach($myArray as $myData) {
    $myVariable = \'x\';
}

Does PHP destroy it, and

4条回答
提交回复
热议问题