Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /proc/self/root/usr/local/src/php72/php-7.2.12/php-7.2.12/ext/pdo/tests/ |
Current File : //proc/self/root/usr/local/src/php72/php-7.2.12/php-7.2.12/ext/pdo/tests/bug_52098.phpt |
--TEST-- PDO Common: Bug #52098 Own PDOStatement implementation ignore __call() --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); require_once $dir . 'pdo_test.inc'; PDOTest::skip(); ?> --FILE-- <?php if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); @$db->exec("DROP TABLE test"); $db->exec("CREATE TABLE test (x int)"); $db->exec("INSERT INTO test VALUES (1)"); class MyStatement extends PDOStatement { public function __call($name, $arguments) { echo "Calling object method '$name'" . implode(', ', $arguments). "\n"; } } /* Test prepared statement with PDOStatement class. */ $derived = $db->prepare('SELECT * FROM test', array(PDO::ATTR_STATEMENT_CLASS=>array('MyStatement'))); $derived->execute(); $derived->foo(); $derived->fetchAll(); $derived = null; /* Test regular statement with PDOStatement class. */ $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('MyStatement')); $r = $db->query('SELECT * FROM test'); echo $r->bar(); $r->fetchAll(); $r = null; /* Test object instance of PDOStatement class. */ $obj = new MyStatement; echo $obj->lucky(); $db->exec("DROP TABLE test"); ?> ===DONE=== --EXPECTF-- Calling object method 'foo' Calling object method 'bar' Calling object method 'lucky' ===DONE===
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare