Test Failure Report for ext/pdo_odbc/tests/pdo_024.phpt ('ODBC PDO Common: assert that bindParam does not modify parameter')
Script
1:
<?php 2: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); 3: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; 4: $db = PDOTest::factory(); 5: 6: $db->exec('create table test (id int, name varchar(10))'); 7: 8: $stmt = $db->prepare('insert into test (id, name) values(0, :name)'); 9: $name = NULL; 10: $before_bind = $name; 11: $stmt->bindParam(':name', $name); 12: if ($name !== $before_bind) { 13: echo "bind: fail\n"; 14: } else { 15: echo "bind: success\n"; 16: } 17: var_dump($stmt->execute()); 18: var_dump($db->query('select name from test where id=0')->fetchColumn()); 19: 20: ?> 21:
Expected
bind: success
bool(true)
NULL
Output
bind: success
bool(true)
string(0) ""
Diff
# original source file: ext/pdo/tests/pdo_024.phpt
003+ string(0) ""
003- NULL
Generated at Fri, 17 May 2013 23:23:52 +0000 (6 days ago)
|