Annotation of embedaddon/php/ext/pdo/tests/bug61292.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #61292 (Segfault while calling a method on an overloaded PDO object)
        !             3: --SKIPIF--
        !             4: <?php
        !             5: if (!extension_loaded('pdo')) die('skip');
        !             6: $dir = getenv('REDIR_TEST_DIR');
        !             7: if (false == $dir) die('skip no driver');
        !             8: require_once $dir . 'pdo_test.inc';
        !             9: PDOTest::skip();
        !            10: ?>
        !            11: --FILE--
        !            12: <?php
        !            13: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
        !            14: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
        !            15: 
        !            16: class Database_SQL extends PDO
        !            17: {
        !            18:        function __construct()
        !            19:        {
        !            20:                $options = array(PDO::ATTR_PERSISTENT => TRUE);
        !            21:                parent::__construct(getenv("PDOTEST_DSN"), getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options);
        !            22:        }
        !            23: 
        !            24:        var $bar = array();
        !            25: 
        !            26:        public function foo()
        !            27:        {
        !            28:                var_dump($this->bar);
        !            29:        }
        !            30: }
        !            31: 
        !            32: (new Database_SQL)->foo();
        !            33: ?>
        !            34: --EXPECTF--
        !            35: array(0) {
        !            36: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>