qm_assign_ref_unwrap_leak.phpt 308 B

1234567891011121314151617181920
  1. --TEST--
  2. Leak in QM_ASSIGN when unwrapping references (rc=1)
  3. --FILE--
  4. <?php
  5. function &ref() {
  6. $str = "str";
  7. $str .= "str";
  8. return $str;
  9. }
  10. var_dump(true ? ref() : ref());
  11. var_dump(ref() ?: ref());
  12. var_dump(ref() ?? ref());
  13. ?>
  14. --EXPECT--
  15. string(6) "strstr"
  16. string(6) "strstr"
  17. string(6) "strstr"