Merge #1712 Loop 에 사용되는 변수 한번만 호출하는 PR by misol

* pr/1712:
  Unit test 에서 변화된 부분 수정3
  Unit test 에서 변화된 부분 수정2
  Loop 문 변경으로 바뀐 unit 테스트 예측값 추가 수정
  추가 - 변수명 충돌 방지, 테스트 코드 수정
  Loop 에 사용되는 변수 한번만 호출하기
This commit is contained in:
Kijin Sung 2015-10-08 15:08:46 +09:00
commit d0fae0688b
2 changed files with 9 additions and 6 deletions

View file

@ -521,7 +521,10 @@ class TemplateHandler
{
$expr_m[2] .= '=>' . trim($expr_m[3]);
}
$nodes[$idx - 1] .= "<?php if({$expr_m[1]}&&count({$expr_m[1]}))foreach({$expr_m[1]} as {$expr_m[2]}){ ?>";
$nodes[$idx - 1] .= sprintf(
'<?php $t%3$s=%1$s;if($t%3$s&&count($t%3$s))foreach($t%3$s as %2$s){ ?>'
,$expr_m[1], $expr_m[2], md5( $buff . strval($idx-1) )
);
}
elseif($expr_m[4])
{