]> granicus.if.org Git - php/commitdiff
-Add comment that explains wh we need E_ERROR in those cases
authorMarcus Boerger <helly@php.net>
Sat, 2 Feb 2008 15:46:19 +0000 (15:46 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 2 Feb 2008 15:46:19 +0000 (15:46 +0000)
Zend/zend_API.c
Zend/zend_execute_API.c
Zend/zend_vm_def.h

index 3613c9eec901d5b599303ad84d7ce34710ce4662..5291c7eb5e262e7bfd98e78a3d599803c139394e 100644 (file)
@@ -2767,6 +2767,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze
                                        severity = E_STRICT;
                                        verb = "should not";
                                } else {
+                                       /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
                                        severity = E_ERROR;
                                        verb = "cannot";
                                }
index cec985c7be776bfb610284e94312d16ab3bd9c43..b77e7fdda1fd2cae6c05f5a58da0bf03e561ace8 100644 (file)
@@ -1150,6 +1150,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                                severity = E_STRICT;
                                verb = "should not";
                        } else {
+                               /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
                                severity = E_ERROR;
                                verb = "cannot";
                        }
index 9c5861312483d9445ee509c8e701522b1bbef9e2..472e627648b4cb27559729026bc9d748cd8e522b 100644 (file)
@@ -2032,6 +2032,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
                                severity = E_STRICT;
                                verb = "should not";
                        } else {
+                               /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
                                severity = E_ERROR;
                                verb = "cannot";
                        }
@@ -2144,6 +2145,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
                        zend_error(E_STRICT, "Non-static method %v::%v() should not be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
                } else {
                        /* FIXME: output identifiers properly */
+                       /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
                        zend_error_noreturn(E_ERROR, "Non-static method %v::%v() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
                }
        }