1--TEST--
2Zend: Test compile string
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7
8define('ZEND_COMPILE_POSITION_AT_SHEBANG', 0);
9define('ZEND_COMPILE_POSITION_AT_OPEN_TAG', 1);
10define('ZEND_COMPILE_POSITION_AFTER_OPEN_TAG', 2);
11
12$source_string = <<<EOF
13#!/path/to/php
14<?php
15var_dump('php');
16EOF;
17
18zend_test_compile_string($source_string, 'Source string', ZEND_COMPILE_POSITION_AT_SHEBANG);
19
20$source_string = <<<EOF
21#!/path/to/php
22<?php
23var_dump('php');
24EOF;
25
26zend_test_compile_string($source_string, 'Source string', ZEND_COMPILE_POSITION_AT_OPEN_TAG);
27
28$source_string = <<<EOF
29<?php
30var_dump('php');
31EOF;
32
33zend_test_compile_string($source_string, 'Source string', ZEND_COMPILE_POSITION_AT_OPEN_TAG);
34
35$source_string = <<<EOF
36var_dump('php');
37EOF;
38
39zend_test_compile_string($source_string, 'Source string', ZEND_COMPILE_POSITION_AFTER_OPEN_TAG);
40
41$source_string = <<<EOF
42<?php
43var_dump('php');
44EOF;
45
46zend_test_compile_string($source_string, 'Source string', ZEND_COMPILE_POSITION_AFTER_OPEN_TAG);
47?>
48--EXPECT--
49string(3) "php"
50#!/path/to/php
51string(3) "php"
52string(3) "php"
53string(3) "php"
54
55Parse error: syntax error, unexpected token "<", expecting end of file in Source string on line 1
56