wrong_inlining_001.phpt 414 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Pass result of inlined function by reference
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. --EXTENSIONS--
  8. opcache
  9. --FILE--
  10. <?php
  11. function get_const() {
  12. return 42;
  13. }
  14. function test() {
  15. foo(get_const());
  16. }
  17. if (true) {
  18. function foo(&$ref) {}
  19. }
  20. test();
  21. ?>
  22. OK
  23. --EXPECTF--
  24. Notice: Only variables should be passed by reference in %swrong_inlining_001.php on line 7
  25. OK