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

index 7cc21891812b4b58bebdbf725a753b54d60609d4..fe921a0ddcdc644d2b5300bc99c369e9534da8b2 100644 (file)
@@ -2406,6 +2406,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 1eca3b1ec8a39df8085a0a77826a86b09e4d4c62..8b5b08be598fd904350151337c4f74cd9900ef13 100644 (file)
@@ -1051,6 +1051,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 8cb595e36e66640126183952bfb4d6da44882cfe..a89f6d7660c2338c9b6346baec1eca96d605c1da 100644 (file)
@@ -1975,6 +1975,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";
                        }
@@ -2082,6 +2083,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
                        zend_error(E_STRICT, "Non-static method %s::%s() 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 %s::%s() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
                }
        }