|
40 | 40 | #define OCI_STMT_CALL 10
|
41 | 41 | #endif
|
42 | 42 |
|
| 43 | +#define ERROR_ARG_POS(arg_num) (getThis() ? (arg_num-1) : (arg_num)) |
| 44 | + |
43 | 45 | /* {{{ Register a callback function for Oracle Transparent Application Failover (TAF) */
|
44 | 46 | PHP_FUNCTION(oci_register_taf_callback)
|
45 | 47 | {
|
@@ -258,7 +260,7 @@ PHP_FUNCTION(oci_lob_save)
|
258 | 260 | }
|
259 | 261 |
|
260 | 262 | if (offset < 0) {
|
261 |
| - zend_argument_value_error(2, "must be greater than or equal to 0"); |
| 263 | + zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0"); |
262 | 264 | RETURN_THROWS();
|
263 | 265 | }
|
264 | 266 |
|
@@ -350,7 +352,7 @@ PHP_FUNCTION(oci_lob_read)
|
350 | 352 | }
|
351 | 353 |
|
352 | 354 | if (length <= 0) {
|
353 |
| - zend_argument_value_error(1, "must be greater than 0"); |
| 355 | + zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than 0"); |
354 | 356 | RETURN_THROWS();
|
355 | 357 | }
|
356 | 358 |
|
@@ -600,7 +602,7 @@ PHP_FUNCTION(oci_lob_truncate)
|
600 | 602 | }
|
601 | 603 |
|
602 | 604 | if (trim_length < 0) {
|
603 |
| - zend_argument_value_error(1, "must be greater than or equal to zero"); |
| 605 | + zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than or equal to 0"); |
604 | 606 | RETURN_THROWS();
|
605 | 607 | }
|
606 | 608 |
|
@@ -635,14 +637,14 @@ PHP_FUNCTION(oci_lob_erase)
|
635 | 637 | if (offset_is_null) {
|
636 | 638 | offset = -1;
|
637 | 639 | } else if (offset < 0) {
|
638 |
| - zend_argument_value_error(1, "must be greater than or equal to 0"); |
| 640 | + zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than or equal to 0"); |
639 | 641 | RETURN_THROWS();
|
640 | 642 | }
|
641 | 643 |
|
642 | 644 | if (length_is_null) {
|
643 | 645 | length = -1;
|
644 | 646 | } else if (length < 0) {
|
645 |
| - zend_argument_value_error(2, "must be greater than or equal to 0"); |
| 647 | + zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0"); |
646 | 648 | RETURN_THROWS();
|
647 | 649 | }
|
648 | 650 |
|
@@ -833,14 +835,14 @@ PHP_FUNCTION(oci_lob_export)
|
833 | 835 | if (start_is_null) {
|
834 | 836 | start = -1;
|
835 | 837 | } else if (start < 0) {
|
836 |
| - zend_argument_value_error(2, "must be greater than or equal to 0"); |
| 838 | + zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0"); |
837 | 839 | RETURN_THROWS();
|
838 | 840 | }
|
839 | 841 |
|
840 | 842 | if (length_is_null) {
|
841 | 843 | length = -1;
|
842 | 844 | } else if (length < 0) {
|
843 |
| - zend_argument_value_error(3, "must be greater than or equal to 0"); |
| 845 | + zend_argument_value_error(ERROR_ARG_POS(4), "must be greater than or equal to 0"); |
844 | 846 | RETURN_THROWS();
|
845 | 847 | }
|
846 | 848 |
|
|
0 commit comments