bug80839.phpt 755 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #80839: PHP problem with JIT
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.jit_buffer_size=1M
  7. opcache.jit=function
  8. --EXTENSIONS--
  9. opcache
  10. --FILE--
  11. <?php
  12. $a = null; // the problem only occurs when set to NULL
  13. test($a, 'y');
  14. function test($str, $pad) {
  15. $x = $str . str_repeat($pad, 15); // $x now contains "yyyyyyyyyyyyyyy"
  16. var_dump($x);
  17. $gft = new gft();
  18. $gft->info(33);
  19. // $x has been changed ????
  20. // $x contains what was echoed in the function 'info'
  21. var_dump($x);
  22. }
  23. class gft {
  24. private $strVal = 'abcd ';
  25. public function info($info, $prefix = ' Info:') {
  26. echo $this->strVal.$prefix.serialize($info).'aaaa';
  27. echo "\n";
  28. }
  29. }
  30. ?>
  31. --EXPECT--
  32. string(15) "yyyyyyyyyyyyyyy"
  33. abcd Info:i:33;aaaa
  34. string(15) "yyyyyyyyyyyyyyy"