Arquivos
hhvm/hphp/test/vm/reqonce.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

23 linhas
587 B
PHP

<?php
$c = new TestClass;
$c->testwithctx();
testnoctx();
function testnoctx() {
echo "testing from anonymous context\n";
echo "testvar set before Req? " . isset($testvar) . "\n";
require 'reqtests/mod.php';
echo "testvar set after Req? " . isset($testvar) . "\n";
}
class TestClass {
private $var = 'hello';
public function testwithctx() {
echo "value of var before ReqOnce: " . $this->var . "\n";
require_once 'reqtests/mod.php';
echo "value of var after ReqOnce: " . $this->var . "\n";
echo "testvar set after ReqOnce? " . isset($testvar) . "\n";
}
}