Hello, everybody.
While working with static variables inside static class' methods, I have
found this very interesting (at least for me) behavior of PHP.
Consider the following class definitions (example #1):
class X {
public final static function test() {
static $i;
return ++$i;
}
}
class Y
outside the test method.
The second case is referencing the varible of the class.
2011/7/6 Дмитрий Степанов dmit...@stepanov.lv
Hello, everybody.
While working with static variables inside static class' methods, I have
found this very interesting (at least for me) behavior of PHP
Hello, everybody.
Consider the following code:
class DB {
public function query( $sql) {
// ... some magic of DB querying
}
}
class DBReader {
public $DB;// instance of DB
public function __call( $methodName, $args) {
return call_user_func_array( array( $this, $methodName), $args);
}
protected
3 matches
Mail list logo