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