-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsample.expected.html
More file actions
134 lines (120 loc) · 6.06 KB
/
sample.expected.html
File metadata and controls
134 lines (120 loc) · 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">/*
more
than
one
line
comment
*/</span>
<span style="color:Green;">// single line comment</span>
<span style="color:Green;"># a different single line comment</span>
$foo = <span style="color:#A31515;">'a string'</span>
$foo2 = <span style="color:#A31515;">"a string"</span>
<span style="color:Green;">//$foo = 'a string'</span>
<span style="color:Green;">//$foo2 = "a string"</span>
$foo3 = <span style="color:#A31515;">"a string"</span> <span style="color:Green;">// a comment</span>
<span style="color:Green;">/* Incorrect Method: */</span>
<span style="color:Blue;">if</span>($a > $b):
<span style="color:Blue;">echo</span> $a.<span style="color:#A31515;">" is greater than "</span>.$b;
<span style="color:Blue;">else</span> <span style="color:Blue;">if</span>($a == $b): <span style="color:Green;">// Will not compile.</span>
<span style="color:Blue;">echo</span> <span style="color:#A31515;">"The above line causes a parse error."</span>;
<span style="color:Blue;">endif</span>;
<span style="color:Green;">/* Correct Method: */</span>
<span style="color:Blue;">if</span>($a > $b):
<span style="color:Blue;">echo</span> $a.<span style="color:#A31515;">" is greater than "</span>.$b;
<span style="color:Blue;">elseif</span>($a == $b): <span style="color:Green;">// Note the combination of the words.</span>
<span style="color:Blue;">echo</span> $a.<span style="color:#A31515;">" equals "</span>.$b;
<span style="color:Blue;">else</span>:
<span style="color:Blue;">echo</span> $a.<span style="color:#A31515;">" is neither greater than or equal to "</span>.$b;
<span style="color:Blue;">endif</span>;
<?php
$<span style="color:Blue;">file</span> = fopen(<span style="color:#A31515;">"welcome.txt"</span>, <span style="color:#A31515;">"r"</span>) <span style="color:Blue;">or</span> <span style="color:Blue;">exit</span>(<span style="color:#A31515;">"Unable to open file!"</span>);
<span style="color:Green;">//Output a line of the file until the end is reached</span>
<span style="color:Green;">/* single line comment */</span>
<span style="color:Blue;">echo</span> <span style="color:#A31515;">"<table width=\"175\" border=\"1\" class=\"Table1\">\n"</span>;
$regex = <span style="color:#A31515;">'/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/'</span>;
<span style="color:Blue;">while</span>(!feof($<span style="color:Blue;">file</span>))
{
<span style="color:Blue;">echo</span> fgets($<span style="color:Blue;">file</span>). <span style="color:#A31515;">"<br />"</span>;
<span style="color:Green;">/* single line comment */</span>
}
<span style="color:Green;">/*multi line style
* Second line
* third line
* fourth line
*/</span>
<span style="color:Blue;">fclose</span>($<span style="color:Blue;">file</span>);
<span style="color:Blue;">mysqli_fetch_object</span>())
<span style="color:Blue;">and</span>
<span style="color:Blue;">__LINE__</span>
<span style="color:Blue;">class</span>
<span style="color:Blue;">die</span>()
<span style="color:Blue;">empty</span>()
<span style="color:Blue;">endswitch</span>
<span style="color:Blue;">for</span>
<span style="color:Blue;">include</span>()
<span style="color:Blue;">print</span>()
<span style="color:Blue;">switch</span>
<span style="color:Blue;">__FUNCTION__</span>
<span style="color:Blue;">interface</span>
<span style="color:Blue;">protected</span>
<span style="color:Blue;">throw</span>
<span style="color:Blue;">or</span>
<span style="color:Blue;">array</span>()
<span style="color:Blue;">const</span>
<span style="color:Blue;">do</span>
<span style="color:Blue;">enddeclare</span>
<span style="color:Blue;">endwhile</span>
<span style="color:Blue;">foreach</span>
<span style="color:Blue;">include_once</span>()
<span style="color:Blue;">require</span>()
<span style="color:Blue;">unset</span>()
<span style="color:Blue;">__CLASS__</span>
<span style="color:Blue;">implements</span>
<span style="color:Blue;">abstract</span>
<span style="color:Blue;">cfunction</span>
<span style="color:Blue;">namespace</span>
<span style="color:Blue;">xor</span>
<span style="color:Blue;">as</span>
<span style="color:Blue;">continue</span>
<span style="color:Blue;">echo</span>()
<span style="color:Blue;">endfor</span>
<span style="color:Blue;">eval</span>()
<span style="color:Blue;">function</span>
<span style="color:Blue;">isset</span>()
<span style="color:Blue;">require_once</span>()
<span style="color:Blue;">use</span>
<span style="color:Blue;">__METHOD__</span>
<span style="color:Blue;">clone</span>
<span style="color:Blue;">old_function</span>
<span style="color:Blue;">goto</span>
<span style="color:Blue;">__FILE__</span>
<span style="color:Blue;">break</span>
<span style="color:Blue;">declare</span>
<span style="color:Blue;">else</span>
<span style="color:Blue;">endforeach</span>
<span style="color:Blue;">exit</span>()
<span style="color:Blue;">global</span>
<span style="color:Blue;">list</span>()
<span style="color:Blue;">return</span>()
<span style="color:Blue;">var</span>
<span style="color:Blue;">final</span>
<span style="color:Blue;">public</span>
<span style="color:Blue;">try</span>
this
<span style="color:Blue;">exception</span>
<span style="color:Blue;">case</span>
<span style="color:Blue;">default</span>
<span style="color:Blue;">elseif</span>
<span style="color:Blue;">endif</span>
<span style="color:Blue;">extends</span>
<span style="color:Blue;">if</span>
<span style="color:Blue;">new</span>
<span style="color:Blue;">static</span>
<span style="color:Blue;">while</span>
<span style="color:Blue;">php_user_filter</span>
<span style="color:Blue;">private</span>
<span style="color:Blue;">catch</span>
<span style="color:Blue;">final</span>
?>
</pre></div>