1--TEST--
2PDO_OCI: Attribute: Client version
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
6require(dirname(__FILE__).'/../../pdo/tests/pdo_test.inc');
7PDOTest::skip();
8?>
9--FILE--
10<?php
11
12require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc');
13
14$dbh = PDOTest::factory();
15
16echo "ATTR_CLIENT_VERSION: ";
17$cv = $dbh->getAttribute(PDO::ATTR_CLIENT_VERSION);
18var_dump($cv);
19
20$s = explode(".", $cv);
21if (count($s) > 1 && (($s[0] == 10 && $s[1] >= 2) || $s[0] >= 11)) {
22	if (count($s) != 5) {
23		echo "Wrong number of values in array\nVersion was: ";
24		var_dump($cv);
25	} else {
26		echo "Version OK, so far as can be portably checked\n";
27	}
28} else {
29	if (count($s) != 2) {
30		echo "Wrong number of values in array\nVersion was: ";
31		var_dump($cv);
32	} else {
33		echo "Version OK, so far as can be portably checked\n";
34	}
35}
36
37echo "Done\n";
38
39?>
40--EXPECTF--
41ATTR_CLIENT_VERSION: string(%d) "%d.%s"
42Version OK, so far as can be portably checked
43Done
44