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