nowdoc_015.phpt 846 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --TEST--
  2. Test nowdoc and line numbering
  3. --FILE--
  4. <?php
  5. function error_handler($num, $msg, $file, $line) {
  6. echo $line,"\n";
  7. }
  8. set_error_handler('error_handler');
  9. trigger_error("line", E_USER_ERROR);
  10. $x = <<<EOF
  11. EOF;
  12. var_dump($x);
  13. trigger_error("line", E_USER_ERROR);
  14. $x = <<<'EOF'
  15. EOF;
  16. var_dump($x);
  17. trigger_error("line", E_USER_ERROR);
  18. $x = <<<EOF
  19. test
  20. EOF;
  21. var_dump($x);
  22. trigger_error("line", E_USER_ERROR);
  23. $x = <<<'EOF'
  24. test
  25. EOF;
  26. var_dump($x);
  27. trigger_error("line", E_USER_ERROR);
  28. $x = <<<EOF
  29. test1
  30. test2
  31. test3
  32. EOF;
  33. var_dump($x);
  34. trigger_error("line", E_USER_ERROR);
  35. $x = <<<'EOF'
  36. test1
  37. test2
  38. test3
  39. EOF;
  40. var_dump($x);
  41. trigger_error("line", E_USER_ERROR);
  42. echo "ok\n";
  43. ?>
  44. --EXPECT--
  45. 6
  46. string(0) ""
  47. 10
  48. string(0) ""
  49. 14
  50. string(4) "test"
  51. 19
  52. string(4) "test"
  53. 24
  54. string(20) "test1
  55. test2
  56. test3
  57. "
  58. 34
  59. string(20) "test1
  60. test2
  61. test3
  62. "
  63. 44
  64. ok