1--TEST--
2SQLite3::prepare number of rows
3--EXTENSIONS--
4sqlite3
5--SKIPIF--
6<?php
7// Create an instance of the ReflectionMethod class
8try {
9    $method = new ReflectionMethod('sqlite3result', 'numRows');
10} catch (ReflectionException $e) {
11    die("skip SQLite3Result::numRows method does not exist");
12}
13?>
14--FILE--
15<?php
16
17require_once(__DIR__ . '/new_db.inc');
18define('TIMENOW', time());
19
20echo "Creating Table\n";
21var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
22
23echo "INSERT into table\n";
24var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')"));
25var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
26
27echo "SELECTING results\n";
28$results = $db->query("SELECT * FROM test ORDER BY id ASC");
29echo "Number of rows\n";
30var_dump($results->numRows());
31$results->finalize();
32
33echo "Closing database\n";
34var_dump($db->close());
35echo "Done\n";
36?>
37--EXPECT--
38Creating Table
39bool(true)
40INSERT into table
41bool(true)
42bool(true)
43SELECTING results
44Number of rows
45int(2)
46Closing database
47bool(true)
48Done
49