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