|
29 | 29 | PHPAPI zend_class_entry *php_ce_incomplete_class;
|
30 | 30 | static zend_object_handlers php_incomplete_object_handlers;
|
31 | 31 |
|
32 |
| -/* {{{ incomplete_class_message */ |
33 | 32 | static void incomplete_class_message(zend_object *object, int error_type)
|
34 | 33 | {
|
35 |
| - zend_string *class_name; |
36 |
| - |
37 |
| - class_name = php_lookup_class_name(object); |
| 34 | + zend_string *class_name = php_lookup_class_name(object); |
| 35 | + php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, |
| 36 | + class_name ? ZSTR_VAL(class_name) : "unknown"); |
| 37 | + if (class_name) { |
| 38 | + zend_string_release_ex(class_name, 0); |
| 39 | + } |
| 40 | +} |
38 | 41 |
|
| 42 | +static void throw_incomplete_class_error(zend_object *object) |
| 43 | +{ |
| 44 | + zend_string *class_name = php_lookup_class_name(object); |
| 45 | + zend_throw_error(NULL, INCOMPLETE_CLASS_MSG, class_name ? ZSTR_VAL(class_name) : "unknown"); |
39 | 46 | if (class_name) {
|
40 |
| - php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, ZSTR_VAL(class_name)); |
41 | 47 | zend_string_release_ex(class_name, 0);
|
42 |
| - } else { |
43 |
| - php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, "unknown"); |
44 | 48 | }
|
45 | 49 | }
|
46 |
| -/* }}} */ |
47 | 50 |
|
48 | 51 | static zval *incomplete_class_get_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv) /* {{{ */
|
49 | 52 | {
|
@@ -87,7 +90,7 @@ static int incomplete_class_has_property(zend_object *object, zend_string *membe
|
87 | 90 |
|
88 | 91 | static zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
|
89 | 92 | {
|
90 |
| - incomplete_class_message(*object, E_ERROR); |
| 93 | + throw_incomplete_class_error(*object); |
91 | 94 | return NULL;
|
92 | 95 | }
|
93 | 96 | /* }}} */
|
|
0 commit comments