global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / reqonce.php
blobaf503669b885f7df9b2d5ef1d11c09454c984b92
1 <?hh
2 $c = new TestClass;
3 $c->testwithctx();
4 testnoctx();
6 function testnoctx() {
7 echo "testing from anonymous context\n";
8 echo "testvar set before Req? " . isset($testvar) . "\n";
9 require 'reqtests/mod.inc';
10 echo "testvar set after Req? " . isset($testvar) . "\n";
13 class TestClass {
14 private $var = 'hello';
16 public function testwithctx() {
17 echo "value of var before ReqOnce: " . $this->var . "\n";
18 require_once 'reqtests/mod.inc';
19 echo "value of var after ReqOnce: " . $this->var . "\n";
20 echo "testvar set after ReqOnce? " . isset($testvar) . "\n";