global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / xhp_file_line.php
blobfb69bbc2560e225f3b9e2e0e1e4d54e19029159d
1 <?hh
3 class :xhp {
4 public function __construct($attributes, $children, $file=null, $line=null) {
5 $assert = function($cond) {
6 if (!$cond) {
7 throw new Exception('fail');
9 };
10 $assert(is_array($attributes));
11 $assert(is_array($children));
12 $assert($file === __FILE__);
13 $assert($line === $attributes['line']);
17 <xhp line={__LINE__} />;
18 <xhp line={__LINE__}>text</xhp>;
19 <xhp line={__LINE__} some-attr="value" />;
20 <xhp line={__LINE__} attr1="one" a2={2}>text</xhp>;
22 echo "pass\n";