Skip to content

Commit 3bcbf0a

Browse files
committed
Fix ZEND_BEGIN_ARG_INFO_EX for ibase_commit
When running a debug build of PHP, the engine verifies that the info supplied in the `ZEND_BEGIN_ARG_INFO_EX` macro is correct. The last parameter of the `ZEND_BEGIN_ARG_INFO_EX` macro is the number of required arguments. If we try to invoke `ibase_commit` with zero arguments, we get the following error message: ``` Fatal error: Arginfo / zpp mismatch during call of ibase_commit() in test.php on line 123 ``` This patch corrects this by setting the value to zero to match how the method is implemented.
1 parent 3cdd24f commit 3bcbf0a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

interbase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_trans, 0, 0, 0)
9191
ZEND_ARG_INFO(0, trans_args)
9292
ZEND_END_ARG_INFO()
9393

94-
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_commit, 0, 0, 1)
94+
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_commit, 0, 0, 0)
9595
ZEND_ARG_INFO(0, link_identifier)
9696
ZEND_END_ARG_INFO()
9797

tests/ibase_commit_001.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
ibase_commit(): Make sure the method can be invoked with zero arguments
3+
--SKIPIF--
4+
<?php include("skipif.inc"); ?>
5+
--FILE--
6+
<?php
7+
8+
require("interbase.inc");
9+
10+
ibase_connect($test_base);
11+
12+
ibase_query('INSERT INTO test1 VALUES (100, 2)');
13+
14+
var_dump(ibase_commit());
15+
16+
?>
17+
--EXPECTF--
18+
bool(true)

0 commit comments

Comments
 (0)