cmp_004.phpt 390 B

12345678910111213141516171819202122
  1. --TEST--
  2. JIT CMP: 004 Comparisons inside conditional statement
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_update_protection=0
  7. opcache.jit_buffer_size=1M
  8. opcache.protect_memory=1
  9. --EXTENSIONS--
  10. opcache
  11. --FILE--
  12. <?php
  13. function foo(bool $test, int $x) {
  14. if (($test ? $x >= 1 : $x > 1)) {
  15. return 1;
  16. }
  17. return 0;
  18. }
  19. var_dump(foo(true, 9));
  20. ?>
  21. --EXPECT--
  22. int(1)