File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / sqlite / tests / sqlite_popen_basic.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:02 2012 UTC (13 years, 3 months ago) by misho
Branches: php, MAIN
CVS tags: v5_3_10, HEAD
php

--TEST--
SQLite: sqlite_popen() basic tests
--SKIPIF--
<?php if (!extension_loaded("sqlite")) print "skip"; ?>
--FILE--
<?php
/* Prototype  : resource sqlite_popen(string filename [, int mode [, string &error_message]])
 * Description: Opens a persistent handle to a SQLite database. Will create the database if it does not exist.
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions:
*/

	$db1 = sqlite_popen(":memory:");
	$db2 = sqlite_popen(":memory:");

	var_dump($db1);
	var_dump($db2);

	list($resourceId1) = sscanf((string) $db1, "resource(%d) of type (sqlite database (persistent))");
	list($resourceId2) = sscanf((string) $db2, "resource(%d) of type (sqlite database (persistent))");

	var_dump($resourceId1 === $resourceId2);
?>
--EXPECTF--
resource(%d) of type (sqlite database (persistent))
resource(%d) of type (sqlite database (persistent))
bool(true)

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