019.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. --EXPECTF--
  14. hey, this is a regular echo'd eval()
  15. hey, this is a function inside an eval()!
  16. hey, this is a regular echo'd eval()
  17. hey, this is a function inside an eval()!
  18. hey, this is a regular echo'd eval()
  19. hey, this is a function inside an eval()!
  20. hey, this is a regular echo'd eval()
  21. hey, this is a function inside an eval()!
  22. hey, this is a regular echo'd eval()
  23. hey, this is a function inside an eval()!
  24. hey, this is a regular echo'd eval()
  25. hey, this is a function inside an eval()!
  26. hey, this is a regular echo'd eval()
  27. hey, this is a function inside an eval()!
  28. hey, this is a regular echo'd eval()
  29. hey, this is a function inside an eval()!
  30. hey, this is a regular echo'd eval()
  31. hey, this is a function inside an eval()!
  32. hey, this is a regular echo'd eval()
  33. hey, this is a function inside an eval()!
  34. Parse error: syntax error, unexpected %s in %s019.php(12) : eval()'d code on line 1