diff options
author | Xinchen Hui <laruence@php.net> | 2012-03-06 06:24:50 +0000 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-03-06 06:24:50 +0000 |
commit | 02b3b616cecd5bee7201eab43c2bade0ff6f1791 (patch) | |
tree | 0bd26668c3ef16965c66710b1d1da03e1808a694 | |
parent | 1a1a8242c42d13b6fdd8d30233022db3a53419c4 (diff) | |
download | php-git-02b3b616cecd5bee7201eab43c2bade0ff6f1791.tar.gz |
Add test for bug #61292, bug was fixed in -r323935
-rw-r--r-- | ext/pdo/tests/bug61292.phpt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ext/pdo/tests/bug61292.phpt b/ext/pdo/tests/bug61292.phpt new file mode 100644 index 0000000000..2381fd1a23 --- /dev/null +++ b/ext/pdo/tests/bug61292.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #61292 (Segfault while calling a method on an overloaded PDO object) +--SKIPIF-- +<?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'; + +class Database_SQL extends PDO +{ + function __construct() + { + $options = array(PDO::ATTR_PERSISTENT => TRUE); + parent::__construct(getenv("PDOTEST_DSN"), getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options); + } + + var $bar = array(); + + public function foo() + { + var_dump($this->bar); + } +} + +(new Database_SQL)->foo(); +?> +--EXPECTF-- +array(0) { +} |