Exemplo n.º 1
0
        print "  C::b: " . C::$b . "\n";
        #    print "  C::c: " . C::$c . "\n";
        print "  C::d: " . C::$d . "\n";
        print "  C::e: " . C::$e . "\n";
        #    print "  C::f: " . C::$f . "\n";
        print "  C::g: " . C::$g . "\n";
        print "  C::h: " . C::$h . "\n";
    }
}
$a = new A();
$a->aFunc();
$b = new B();
$b->aFunc();
$b->bFunc();
$c = new C();
$c->aFunc();
$c->bFunc();
$c->cFunc();
print "isset(C::\$h): " . (isset(C::$h) ? "true" : "false") . "\n";
print "empty(C::\$h): " . (empty(C::$h) ? "true" : "false") . "\n";
print "isset(C::\$i): " . (isset(C::$i) ? "true" : "false") . "\n";
print "empty(C::\$i): " . (empty(C::$i) ? "true" : "false") . "\n";
print "C::\$h: " . C::$h . "\n";
C::$h = 42;
print "C::\$h: " . C::$h . "\n";
C::$h += 42;
print "C::\$h: " . C::$h . "\n";
print "C::\$h: " . ++C::$h . "\n";
print "C::\$h: " . C::$h++ . "\n";
print "C::\$h: " . C::$h-- . "\n";
print "C::\$h: " . --C::$h . "\n";
Exemplo n.º 2
0
 static function main()
 {
     $a = new A();
     $a->aFunc();
     $b = new B();
     $b->aFunc();
     $b->bFunc();
     $c = new C();
     $c->aFunc();
     $c->bFunc();
     $c->cFunc();
     print "isset(C::\$h): " . (isset(C::$h) ? "true" : "false") . "\n";
     print "empty(C::\$h): " . (empty(C::$h) ? "true" : "false") . "\n";
     print "isset(C::\$i): " . (isset(C::$i) ? "true" : "false") . "\n";
     print "empty(C::\$i): " . (empty(C::$i) ? "true" : "false") . "\n";
     print "C::\$h: " . C::$h . "\n";
     C::$h = 42;
     print "C::\$h: " . C::$h . "\n";
     C::$h += 42;
     print "C::\$h: " . C::$h . "\n";
     print "C::\$h: " . ++C::$h . "\n";
     print "C::\$h: " . C::$h++ . "\n";
     print "C::\$h: " . C::$h-- . "\n";
     print "C::\$h: " . --C::$h . "\n";
     $x = 1234;
     C::$h =& $x;
     print "C::\$h: " . C::$h . "\n";
     $x++;
     print "C::\$h: " . C::$h . "\n";
     C::$h = 5678;
     print "x: " . $x . "\n";
     C::$h = array(0, 1, 2);
     $y = C::$h[1];
     print "\$y: {$y}\n";
     C::$h[2] = 42;
     $y = C::$h[2];
     print "\$y: {$y}\n";
     C::$h = 20;
     $w =& C::$h;
     $w = 5;
     print "C::\$h: " . C::$h . "\n";
     print "Test end\n";
 }