coalesce.phpt 691 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. COALESCE optimization
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. opcache.opt_debug_level=0x20000
  8. --EXTENSIONS--
  9. opcache
  10. --FILE--
  11. <?php
  12. function a() {
  13. $test = $test ?? true;
  14. return $test;
  15. }
  16. function b() {
  17. $test ??= true;
  18. return $test;
  19. }
  20. ?>
  21. --EXPECTF--
  22. $_main:
  23. ; (lines=1, args=0, vars=0, tmps=0)
  24. ; (after optimizer)
  25. ; %s
  26. 0000 RETURN int(1)
  27. a:
  28. ; (lines=2, args=0, vars=1, tmps=1)
  29. ; (after optimizer)
  30. ; %s
  31. 0000 T1 = COALESCE CV0($test) 0001
  32. 0001 RETURN bool(true)
  33. b:
  34. ; (lines=2, args=0, vars=1, tmps=1)
  35. ; (after optimizer)
  36. ; %s
  37. 0000 T1 = COALESCE CV0($test) 0001
  38. 0001 RETURN bool(true)