Arquivos
hhvm/hphp/test/vm/SetOpProp.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

74 linhas
1.1 KiB
PHP

<?php
print "Test begin\n";
class C {
public $p = 0;
}
class D {
private $container = array("a" => "D::a", "b" => 42);
public $p = 0;
public function __get($k) {
print "In D::__get($k)\n";
return isset($this->container[$k]) ? $this->container[$k] : null;
}
}
class E {
private $container = array("a" => "E::a", "b" => 42);
public $p = 0;
public function __get($k) {
print "In E::__get($k)\n";
return isset($this->container[$k]) ? $this->container[$k] : null;
}
public function __set($k, $v) {
print "In E::__set($k, $v)\n";
$this->container[$k] = $v;
}
}
$o = new C;
$o->a .= "<a>";
$o->b .= "<b>";
$o->b .= "<b>";
$o->p += 1;
$o->q += 1;
$o->r .= "hello";
print_r($o);
$o = new D;
$o->a .= "<a>";
$o->b .= "<b>";
$o->b .= "<b>";
$o->p += 1;
$o->q += 1;
$o->r .= "hello";
print_r($o);
$o = new E;
$o->a .= "<a>";
$o->b .= "<b>";
$o->b .= "<b>";
$o->p += 1;
$o->q += 1;
$o->r .= "hello";
print_r($o);
$o = null;
$o->a .= "<a>";
$o->b .= "<b>";
$o->b .= "<b>";
$o->p += 1;
$o->q += 1;
$o->r .= "hello";
print_r($o);
$o = 42;
$o->a .= "<a>";
$o->b .= "<b>";
print_r($o);
print "\n";
print "Test end\n";