Hi all.

The attached patch fixes bug #27290 (which could be considered as feature request).
The patch proposes to look at the previous op_code to get real line number & filename 
where the fuction was called.

-- 
Wbr,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Index: zend_execute.c
===================================================================
RCS file: /repository/ZendEngine2/zend_execute.c,v
retrieving revision 1.673
diff -u -r1.673 zend_execute.c
--- zend_execute.c      9 Sep 2004 16:47:22 -0000       1.673
+++ zend_execute.c      10 Sep 2004 05:34:37 -0000
@@ -3371,8 +3371,18 @@
        if (zend_ptr_stack_get_arg(arg_num, (void **) &param TSRMLS_CC)==FAILURE) {
                char *space;
                char *class_name = get_active_class_name(&space TSRMLS_CC);
+               zend_execute_data *ptr = EG(current_execute_data);
+               
+               ptr = ptr->prev_execute_data;
+
                zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, 
NULL TSRMLS_CC);
-               zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", 
opline->op1.u.constant.value.lval, class_name, space, 
get_active_function_name(TSRMLS_C));
+               if (ptr && ptr->op_array) {
+                       zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), 
called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, 
space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, 
ptr->opline->lineno);
+               }
+               else {
+                       zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", 
opline->op1.u.constant.value.lval, class_name, space, 
get_active_function_name(TSRMLS_C));
+               }
+               
                if (opline->result.op_type == IS_VAR) {
                        PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr);
                }

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to