019.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. eval() test
  3. --FILE--
  4. <?php
  5. eval("function test() { echo \"hey, this is a function inside an eval()!\\n\"; }");
  6. $i=0;
  7. while ($i<10) {
  8. eval("echo \"hey, this is a regular echo'd eval()\\n\";");
  9. test();
  10. $i++;
  11. }
  12. eval('-');
  13. ?>
  14. --EXPECTF--
  15. hey, this is a regular echo'd eval()
  16. hey, this is a function inside an eval()!
  17. hey, this is a regular echo'd eval()
  18. hey, this is a function inside an eval()!
  19. hey, this is a regular echo'd eval()
  20. hey, this is a function inside an eval()!
  21. hey, this is a regular echo'd eval()
  22. hey, this is a function inside an eval()!
  23. hey, this is a regular echo'd eval()
  24. hey, this is a function inside an eval()!
  25. hey, this is a regular echo'd eval()
  26. hey, this is a function inside an eval()!
  27. hey, this is a regular echo'd eval()
  28. hey, this is a function inside an eval()!
  29. hey, this is a regular echo'd eval()
  30. hey, this is a function inside an eval()!
  31. hey, this is a regular echo'd eval()
  32. hey, this is a function inside an eval()!
  33. hey, this is a regular echo'd eval()
  34. hey, this is a function inside an eval()!
  35. Parse error: syntax error, unexpected %s in %s019.php(12) : eval()'d code on line 1