ret_004.phpt 433 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. JIT RET: 004 Return a reference when it's not expected
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_update_protection=0
  7. opcache.jit_buffer_size=32M
  8. --FILE--
  9. <?php
  10. class A {
  11. function foo() {
  12. }
  13. function bar() {
  14. $x = $this->foo();
  15. var_dump(str_repeat($x,5));
  16. }
  17. }
  18. class B extends A {
  19. public $prop = "x";
  20. function &foo() {
  21. return $this->prop;
  22. }
  23. }
  24. $b = new B;
  25. $b->bar();
  26. ?>
  27. --EXPECT--
  28. string(5) "xxxxx"