]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 11 Jun 2019 08:29:20 +0000 (10:29 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 11 Jun 2019 08:29:20 +0000 (10:29 +0200)
1  2 
Zend/zend_builtin_functions.c
ext/opcache/Optimizer/zend_func_info.c

index 4dca3180e17ce9e86f4133abf6e4f3f15bf30282,2d0db8f7126b74d49e889c5bd5b73cd2aa61bc51..6fb0bfecbe4240ef394d71636b674b86b0ca456e
@@@ -1152,6 -1244,31 +1158,31 @@@ ZEND_FUNCTION(get_object_vars
  }
  /* }}} */
  
 -      properties = Z_OBJ_HT_P(obj)->get_properties(obj);
+ /* {{{ proto array get_mangled_object_vars(object obj)
+    Returns an array of mangled object properties. Does not respect property visibility. */
+ ZEND_FUNCTION(get_mangled_object_vars)
+ {
+       zval *obj;
+       HashTable *properties;
+       ZEND_PARSE_PARAMETERS_START(1, 1)
+               Z_PARAM_OBJECT(obj)
+       ZEND_PARSE_PARAMETERS_END();
++      properties = Z_OBJ_HT_P(obj)->get_properties(Z_OBJ_P(obj));
+       if (!properties) {
+               ZVAL_EMPTY_ARRAY(return_value);
+               return;
+       }
+       properties = zend_proptable_to_symtable(properties,
+               (Z_OBJCE_P(obj)->default_properties_count ||
+                Z_OBJ_P(obj)->handlers != &std_object_handlers ||
+                GC_IS_RECURSIVE(properties)));
+       RETURN_ARR(properties);
+ }
+ /* }}} */
  static int same_name(zend_string *key, zend_string *name) /* {{{ */
  {
        zend_string *lcname;
index 1485c0a73bdd4d5c284b98a181991aff9971b632,78985275ebba3c587e24345bf8f7b95849023612..b4bce7eb60c9cf2643b95e912ff260e9b5d72881
@@@ -96,47 -223,50 +96,48 @@@ static const func_info_t func_infos[] 
        F0("func_num_args",           MAY_BE_LONG),
        FN("func_get_arg",            UNKNOWN_INFO),
        F1("func_get_args",           MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
 -      FC("strlen",                  zend_strlen_info),
 -      FC("strcmp",                  zend_l_ss_info),
 -      FC("strncmp",                 zend_lb_ssn_info),
 -      FC("strcasecmp",              zend_l_ss_info),
 -      FC("strncasecmp",             zend_lb_ssn_info),
 -      F1("each",                    MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_KEY_ANY),
 -      F0("error_reporting",         MAY_BE_NULL | MAY_BE_LONG),
 +      F0("strlen",                  MAY_BE_LONG),
 +      F0("strcmp",                  MAY_BE_LONG),
 +      F0("strncmp",                 MAY_BE_FALSE | MAY_BE_LONG),
 +      F0("strcasecmp",              MAY_BE_LONG),
 +      F0("strncasecmp",             MAY_BE_FALSE | MAY_BE_LONG),
 +      F0("error_reporting",         MAY_BE_LONG),
        F0("define",                  MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_NULL), // TODO: inline
 -      FC("defined",                 zend_b_s_info), // TODO: inline
 +      F0("defined",                 MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
        FN("get_class",               MAY_BE_FALSE | MAY_BE_STRING),
        FN("get_called_class",        MAY_BE_FALSE | MAY_BE_STRING),
 -      FN("get_parent_class",        MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_NULL),
 -      F0("is_subclass_of",          MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
 -      F0("is_a",                    MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
 -      F1("get_class_vars",          MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
 -      FN("get_object_vars",         MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
 -      FN("get_mangled_object_vars", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
 +      FN("get_parent_class",        MAY_BE_FALSE | MAY_BE_STRING),
 +      F0("is_subclass_of",          MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
 +      F0("is_a",                    MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
 +      F1("get_class_vars",          MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
 +      FN("get_object_vars",         MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
++      FN("get_mangled_object_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
        F1("get_class_methods",       MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 -      F0("method_exists",           MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 +      F0("method_exists",           MAY_BE_FALSE | MAY_BE_TRUE),
        F0("property_exists",         MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 -      F0("class_exists",            MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 -      F0("interface_exists",        MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 -      F0("trait_exists",            MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 -      FC("function_exists",         zend_b_s_info), // TODO: inline
 -      F0("class_alias",             MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 -      I1("get_included_files",      MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 -      F0("trigger_error",           MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 -      F0("user_error",              MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
 +      F0("class_exists",            MAY_BE_FALSE | MAY_BE_TRUE),
 +      F0("interface_exists",        MAY_BE_FALSE | MAY_BE_TRUE),
 +      F0("trait_exists",            MAY_BE_FALSE | MAY_BE_TRUE),
 +      F0("function_exists",         MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
 +      F0("class_alias",             MAY_BE_FALSE | MAY_BE_TRUE),
 +      F1("get_included_files",      MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 +      F0("trigger_error",           MAY_BE_FALSE | MAY_BE_TRUE),
 +      F0("user_error",              MAY_BE_FALSE | MAY_BE_TRUE),
        FN("set_error_handler",       MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT),
 -      I0("restore_error_handler",   MAY_BE_TRUE),
 -      I0("restore_exception_handler", MAY_BE_TRUE),
 -      I1("get_declared_traits",     MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 -      I1("get_declared_classes",    MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 -      I1("get_declared_interfaces", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 +      F0("restore_error_handler",   MAY_BE_TRUE),
 +      F0("restore_exception_handler", MAY_BE_TRUE),
 +      F1("get_declared_traits",     MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 +      F1("get_declared_classes",    MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 +      F1("get_declared_interfaces", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
        F1("get_defined_functions",   MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
 -      I1("get_defined_vars",        MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
 -      FN("create_function",         MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
 -      F1("get_resource_type",       MAY_BE_NULL | MAY_BE_STRING),
 -      F1("get_defined_constants",   MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_RESOURCE | MAY_BE_ARRAY_OF_ARRAY),
 +      F1("get_defined_vars",        MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
 +      F1("get_resource_type",       MAY_BE_STRING),
 +      F1("get_defined_constants",   MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_RESOURCE | MAY_BE_ARRAY_OF_ARRAY),
        F0("debug_print_backtrace",   MAY_BE_NULL),
 -      F1("debug_backtrace",         MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
 -      F1("get_loaded_extensions",   MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 -      FC("extension_loaded",        zend_b_s_info),
 -      F1("get_extension_funcs",     MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 +      F1("debug_backtrace",         MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
 +      F1("get_loaded_extensions",   MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
 +      F0("extension_loaded",        MAY_BE_FALSE | MAY_BE_TRUE),
 +      F1("get_extension_funcs",     MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
  
        /* ext/standard */
        FN("constant",                     MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),