dce_006.phpt 875 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. DCE 006: Objects with destructors escape
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. opcache.opt_debug_level=0x20000
  8. opcache.preload=
  9. --EXTENSIONS--
  10. opcache
  11. --FILE--
  12. <?php
  13. class A {
  14. function __destruct() {}
  15. }
  16. function foo(int $x) {
  17. $a = new A;
  18. $a->foo = $x;
  19. }
  20. ?>
  21. --EXPECTF--
  22. $_main:
  23. ; (lines=1, args=0, vars=0, tmps=0)
  24. ; (after optimizer)
  25. ; %sdce_006.php:1-10
  26. 0000 RETURN int(1)
  27. foo:
  28. ; (lines=7, args=1, vars=2, tmps=1)
  29. ; (after optimizer)
  30. ; %sdce_006.php:5-8
  31. 0000 CV0($x) = RECV 1
  32. 0001 V2 = NEW 0 string("A")
  33. 0002 DO_FCALL
  34. 0003 CV1($a) = QM_ASSIGN V2
  35. 0004 ASSIGN_OBJ CV1($a) string("foo")
  36. 0005 OP_DATA CV0($x)
  37. 0006 RETURN null
  38. LIVE RANGES:
  39. 2: 0002 - 0003 (new)
  40. A::__destruct:
  41. ; (lines=1, args=0, vars=0, tmps=0)
  42. ; (after optimizer)
  43. ; %sdce_006.php:3-3
  44. 0000 RETURN null