assign_042.phpt 576 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. JIT ASSIGN: Assign to of reference with 1 refcount
  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. --FILE--
  10. <?php
  11. class Test {
  12. public $prop;
  13. function __construct() {
  14. $this->prop = $this->retref();
  15. }
  16. function &retref() {
  17. return str_repeat("a", 5);
  18. }
  19. }
  20. $o = new Test();
  21. var_dump($o);
  22. ?>
  23. --EXPECTF--
  24. Notice: Only variable references should be returned by reference in %sassign_042.php on line 8
  25. object(Test)#1 (1) {
  26. ["prop"]=>
  27. string(5) "aaaaa"
  28. }