xref: /PHP-8.1/ext/opcache/tests/jit/loop_001.phpt (revision 34f1fdc0)
1--TEST--
2JIT LOOP: 001
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=32M
8;opcache.jit_debug=257
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13function foo($n) {
14  $res = 0;
15  for ($i = 1; $i < $n; $i++)
16    $res = $res + $i;
17  return $res;
18}
19print foo(5);
20?>
21--EXPECT--
2210
23