php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74110 Local scope bound values in a class are not used
Submitted: 2017-02-16 14:56 UTC Modified: 2018-08-27 10:01 UTC
From: allan dot jardine at sprymedia dot co dot uk Assigned: vnkbabu (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.0.16 OS:
Private report: No CVE-ID: None
 [2017-02-16 14:56 UTC] allan dot jardine at sprymedia dot co dot uk
Description:
------------
I believe that this is a occurrence of #59322 which describes exactly the issue I am seeing, however, that bug is marked as fixed in the 1.9.0 release of the ibm_db2 module, while I am using 1.9.9 and seeing this error.

My test case is shown below. If that function is taken out of the class and run directly it runs without issue.

Test script:
---------------
class Test {
	public function run ( $conn ) {
		$stmt = db2_prepare( $conn, 'SELECT * FROM mytable WHERE id = ?' );

		$allanTest = 65;
		db2_bind_param( $stmt, 1, 'allanTest', DB2_PARAM_IN );

		db2_execute( $stmt );

		echo db2_stmt_errormsg();
		var_dump( $stmt );

		while($row = db2_fetch_assoc($stmt)){
			print_r( $row );
		}
	}
}

$t = new Test();
$t->run( $conn );

Expected result:
----------------
The parameters should be bound just like they are if executed outside of a class.

Actual result:
--------------
This is resulting in the following errors:

<br />
<b>Warning</b>:  db2_execute(): Value Not Bound in <b>/var/www/html/db2.php</b> on line <b>114</b><br />
<br />
<b>Warning</b>:  db2_execute(): Binding Error 3 in <b>/var/www/html/db2.php</b> on line <b>114</b><br />
resource(3) of type (DB2 Statement)
<br />

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-13 11:20 UTC] vnkbabu@php.net
-Status: Open +Status: Assigned
 [2017-07-13 11:20 UTC] vnkbabu@php.net
We have able to reproduce the issue in PHP 7.1. Our developer Abhinav Radke is working on the fix. Will update once he fixes the issue.
 [2018-08-27 10:01 UTC] vnkbabu@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: vnkbabu
 [2018-08-27 10:01 UTC] vnkbabu@php.net
Kindly test with latest release. If issue still persist kindly reopen it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC