PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_odbc/tests/bug_39398.phpt ('ODBC PDO Common: Bug #39398 (Booleans are not automatically translated to integers)')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); 
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
5:
$db PDOTest::factory();
6:
$db->exec("CREATE TABLE test (test INT)");
7:
8:
$boolean 1;
9:
$stmt $db->prepare('INSERT INTO test VALUES (:boolean)');
10:
$stmt->bindValue(':boolean', isset($boolean), PDO::PARAM_INT);
11:
$stmt->execute();
12:
13:
var_dump($db->query("SELECT * FROM test")->fetchAll(PDO::FETCH_ASSOC));
14:
?>
15:
===DONE===
16:

Expected

array(1) {
  [0]=>
  array(1) {
    ["test"]=>
    string(1) "1"
  }
}
===DONE===

Output

array(1) {
  [0]=>
  array(1) {
    ["test"]=>
    NULL
  }
}
===DONE===

Diff

# original source file: ext/pdo/tests/bug_39398.phpt
005+     NULL
005-     string(1) "1"

 

Generated at Thu, 10 Apr 2014 08:54:04 +0000 (6 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.