File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / pdo / tests / bug61292.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:31:55 2013 UTC (11 years, 3 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--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()
	{
                $dsn = getenv('PDOTEST_DSN');
                $user = getenv('PDOTEST_USER');
                $pass = getenv('PDOTEST_PASS');

                if ($user === false) $user = NULL;
                if ($pass === false) $pass = NULL;
		$options = array(PDO::ATTR_PERSISTENT => TRUE);

		parent::__construct($dsn, $user, $pass, $options);
	}

	var $bar = array();

	public function foo()
	{
		var_dump($this->bar);
	}
}

(new Database_SQL)->foo();
?>
--EXPECTF--
array(0) {
}

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