loop_001.phpt 322 B

12345678910111213141516171819202122
  1. --TEST--
  2. JIT LOOP: 001
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_update_protection=0
  7. opcache.jit_buffer_size=32M
  8. ;opcache.jit_debug=257
  9. --EXTENSIONS--
  10. opcache
  11. --FILE--
  12. <?php
  13. function foo($n) {
  14. $res = 0;
  15. for ($i = 1; $i < $n; $i++)
  16. $res = $res + $i;
  17. return $res;
  18. }
  19. print foo(5);
  20. ?>
  21. --EXPECT--
  22. 10