summaryrefslogtreecommitdiff
path: root/Zend/tests/nowdoc_015.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-02-12 09:27:45 +0000
committerDmitry Stogov <dmitry@php.net>2008-02-12 09:27:45 +0000
commitddcf7a2f499b00a9a6f402eec256db1cd0deeb4f (patch)
tree5cdf287aabbc497895588d00d613ae13df9e2fbc /Zend/tests/nowdoc_015.phpt
parent51278b6d22bc73c49edbb91992f953477b7e8734 (diff)
downloadphp-git-ddcf7a2f499b00a9a6f402eec256db1cd0deeb4f.tar.gz
Added NEWDOC
Diffstat (limited to 'Zend/tests/nowdoc_015.phpt')
-rw-r--r--Zend/tests/nowdoc_015.phpt74
1 files changed, 74 insertions, 0 deletions
diff --git a/Zend/tests/nowdoc_015.phpt b/Zend/tests/nowdoc_015.phpt
new file mode 100644
index 0000000000..9eb83bd063
--- /dev/null
+++ b/Zend/tests/nowdoc_015.phpt
@@ -0,0 +1,74 @@
+--TEST--
+Test nowdoc and line numbering
+--FILE--
+<?php
+function error_handler($num, $msg, $file, $line, $vars) {
+ echo $line,"\n";
+}
+set_error_handler('error_handler');
+trigger_error("line", E_USER_ERROR);
+$x = <<<EOF
+EOF;
+var_dump($x);
+trigger_error("line", E_USER_ERROR);
+$x = <<<'EOF'
+EOF;
+var_dump($x);
+trigger_error("line", E_USER_ERROR);
+$x = <<<EOF
+test
+EOF;
+var_dump($x);
+trigger_error("line", E_USER_ERROR);
+$x = <<<'EOF'
+test
+EOF;
+var_dump($x);
+trigger_error("line", E_USER_ERROR);
+$x = <<<EOF
+test1
+test2
+
+test3
+
+
+EOF;
+var_dump($x);
+trigger_error("line", E_USER_ERROR);
+$x = <<<'EOF'
+test1
+test2
+
+test3
+
+
+EOF;
+var_dump($x);
+trigger_error("line", E_USER_ERROR);
+echo "ok\n";
+?>
+--EXPECT--
+6
+string(0) ""
+10
+string(0) ""
+14
+string(4) "test"
+19
+string(4) "test"
+24
+string(20) "test1
+test2
+
+test3
+
+"
+34
+string(20) "test1
+test2
+
+test3
+
+"
+44
+ok