]> granicus.if.org Git - php/commitdiff
- Add deprecation flag and message
authorMarcus Boerger <helly@php.net>
Mon, 20 Feb 2006 20:00:46 +0000 (20:00 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 20 Feb 2006 20:00:46 +0000 (20:00 +0000)
Zend/zend_compile.h
Zend/zend_execute_API.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 3bbc5a46dddbca55a59e87597dfd794df2570f32..d1d4a2f744358f5b3879a89639792efa30b2fe23 100644 (file)
@@ -136,6 +136,9 @@ typedef struct _zend_try_catch_element {
 /* shadow of parent's private method/property */
 #define ZEND_ACC_SHADOW 0x20000
 
+/* deprecation flag */
+#define ZEND_ACC_DEPRECATED 0x40000
+
 char *zend_visibility_string(zend_uint fn_flags);
 
 
index f4fceac07f0ebc11714ed6b5ef3e422c528b0c43..d4aa68ba7631d94dcbbad5a43c23024119e736a9 100644 (file)
@@ -861,6 +861,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                fci->object_pp = fci_cache->object_pp;
        }
        
+       if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { 
+               zend_error(E_NOTICE, "Function %s%s%s() is deprecated", 
+                       EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
+                       EX(function_state).function->common.scope ? "::" : "",
+                       EX(function_state).function->common.function_name);
+       }
+
        for (i=0; i<fci->param_count; i++) {
                zval *param;
 
index e72b16c47026e5a493d70e8d985ead87e2e6e918..d4dddb36d1a12c23ceae06a7f5b9f1852128af5e 100644 (file)
@@ -1813,10 +1813,18 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
        zend_bool should_change_scope;
        zend_op *ctor_opline;
 
-       if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
-               /* FIXME: output identifiers properly */
-               zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
-               ZEND_VM_NEXT_OPCODE(); /* Never reached */
+       if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
+               if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
+                       /* FIXME: output identifiers properly */
+                       zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
+                       ZEND_VM_NEXT_OPCODE(); /* Never reached */
+               }
+               if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
+                       zend_error(E_NOTICE, "Function %s%s%s() is deprecated", 
+                               EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
+                               EX(function_state).function->common.scope ? "::" : "",
+                               EX(function_state).function->common.function_name);
+               }
        }
 
        zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL);
index 92a06c0a3c7a5f40257f4090673d18f137c49f97..531d38a61e98303e69cf2c071f38d80103d9386c 100644 (file)
@@ -139,10 +139,18 @@ static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
        zend_bool should_change_scope;
        zend_op *ctor_opline;
 
-       if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
-               /* FIXME: output identifiers properly */
-               zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
-               ZEND_VM_NEXT_OPCODE(); /* Never reached */
+       if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
+               if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
+                       /* FIXME: output identifiers properly */
+                       zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
+                       ZEND_VM_NEXT_OPCODE(); /* Never reached */
+               }
+               if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
+                       zend_error(E_NOTICE, "Function %s%s%s() is deprecated", 
+                               EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
+                               EX(function_state).function->common.scope ? "::" : "",
+                               EX(function_state).function->common.function_name);
+               }
        }
 
        zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL);