]> granicus.if.org Git - php/commitdiff
Remove zend_check_private()
authorDmitry Stogov <dmitry@zend.com>
Thu, 13 Sep 2018 10:47:06 +0000 (13:47 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 13 Sep 2018 10:47:06 +0000 (13:47 +0300)
UPGRADING.INTERNALS
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h

index 526223ddf5a852a488a0bb8f25b92fc2ecb2d1fc..fdcb046a582019b8819cfc8e86757cadf20e2a09 100644 (file)
@@ -4,6 +4,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES
   a. php_sys_symlink() and php_sys_link()
   b. zend_lookup_class_ex() and zend_fetch_class_by_name()
   c. Function/property/class flags
+  d. Removed zend_check_private()
 
 2. Build system changes
   a. Unix build system changes
@@ -35,6 +36,8 @@ PHP 7.4 INTERNALS UPGRADE NOTES
       check property_info->ce (in the same way as with methods).
     - ZEND_ACC_... flags are re-numbered.
 
+  d. zend_check_private() is removed. Use (func->common.scope == scope) instead.
+
 ========================
 2. Build system changes
 ========================
index b664762469c604f04762594da390ae25257a3d86..05c970da8be9e929411703a99d4ced505da154c6 100644 (file)
@@ -1102,36 +1102,6 @@ static zend_never_inline zend_function *zend_get_parent_private_method(zend_clas
 }
 /* }}} */
 
-/* Ensures that we're allowed to call a private method.
- * Returns the function address that should be called, or NULL
- * if no such function exists.
- */
-ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_name) /* {{{ */
-{
-    zend_class_entry *scope;
-
-       if (!ce) {
-               return 0;
-       }
-
-       /* We may call a private function if:
-        * 1.  The class of our object is the same as the scope, and the private
-        *     function (EX(fbc)) has the same scope.
-        * 2.  One of our parent classes are the same as the scope, and it contains
-        *     a private function with the same name that has the same scope.
-        */
-       scope = zend_get_executed_scope();
-       if (fbc->common.scope == scope) {
-               /* rule #1 checks out ok, allow the function call */
-               return 1;
-       }
-
-
-       /* Check rule #2 */
-       return zend_get_parent_private_method(scope, ce, function_name) != NULL;
-}
-/* }}} */
-
 /* Ensures that we're allowed to call a protected method.
  */
 ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope) /* {{{ */
index 662b881d9989fcaae27f33bbbcc03517a9cdff57..9437aaaf762f59c42563e898222b36427dceb5ab 100644 (file)
@@ -199,8 +199,6 @@ ZEND_API int zend_std_compare_objects(zval *o1, zval *o2);
 ZEND_API int zend_std_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr);
 ZEND_API void rebuild_object_properties(zend_object *zobj);
 
-ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_name);
-
 ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
 
 ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name);