<?php /** * Another Foo file used for testing */ $b = Baz::bar();
<?php /** * A simple test class */ class Baz { function bar() { } } $f = new Baz(); $b = $f->bar();
public function bar() { if (self::$d[0] + self::$d[1] + 1 === self::$e[0] + self::$e[1]) { echo "it's all good\n"; } return $this->c; } } class Bar { private $x = array("hey ", "don't make "), $y = array("jude ", "it bad "); private $z; public function __construct() { $this->z = array("", "", ""); $this->z[0] = $this->x[0] . $this->y[0]; $this->z[1] = $this->x[1] . $this->y[1]; $this->z[2] = $this->z[0] . $this->z[1]; echo $this->z[2] . "\n"; } } class Baz extends Foo { } $f = new Foo(); list($s, $i) = $f->bar(); echo $s . $i . "\n"; $g = new Baz(); list($s, $i) = $g->bar(); echo $s . $i . "\n"; new Bar();