<?php class test extends PDO { function __call($name, array $args) { echo "Called {$name} in " . __CLASS__ . "\n"; } function foo() { echo "Called foo in " . __CLASS__ . "\n"; } } if (getenv('REDIR_TEST_DIR') === false) { putenv('REDIR_TEST_DIR=' . dirname(__FILE__) . '/../../pdo/tests/'); } require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $a = new test('sqlite::memory:'); $a->foo(); $a->bar();
<?php class test { function foo() { $a = new test(); $this =& $a; } } $t = new test(); $t->foo(); echo "Done\n";
<?php namespace a\b\c; use a\b\c as test; require "ns_022.inc"; function foo() { echo __FUNCTION__, "\n"; } test\foo(); \test::foo();
<?php class test { protected $foo; private $bar; public $test; function foo() { $this->bar = 'meuh'; $this->foo = 'lala'; $this->test = 'test'; var_dump(http_build_query($this)); } } $obj = new test(); $obj->foo(); var_dump(http_build_query($obj));