1 #include "../../common.h"
2 #include "php_common_handlers.h"
3 #include "zend_smart_str.h"
4 
php_ds_default_cast_object(zend_object * obj,zval * return_value,int type)5 int php_ds_default_cast_object
6 #if PHP_VERSION_ID >= 80000
7 (zend_object *obj, zval *return_value, int type) {
8     zend_class_entry *ce = obj->ce;
9 #else
10 (zval *obj, zval *return_value, int type) {
11     zend_class_entry *ce = Z_OBJCE_P(obj);
12 #endif
13     switch (type) {
14         case IS_STRING: {
15             smart_str buffer = {0};
16 
17             smart_str_appendl(&buffer, "object(", 7);
18             smart_str_append (&buffer, ce->name);
19             smart_str_appendc(&buffer, ')');
20 
21             smart_str_0(&buffer);
22             ZVAL_STR(return_value, buffer.s);
23             return SUCCESS;
24         }
25         case _IS_BOOL: {
26             ZVAL_TRUE(return_value);
27             return SUCCESS;
28         }
29     }
30 
31     return FAILURE;
32 }
33 
34 zval *php_ds_read_dimension_by_key_not_supported
35 #if PHP_VERSION_ID >= 80000
36 (zend_object *obj, zval *offset, int type, zval *rv) {
37 #else
38 (zval *obj, zval *offset, int type, zval *rv) {
39 #endif
40     ARRAY_ACCESS_BY_KEY_NOT_SUPPORTED();
41     return NULL;
42 }
43 
44 int php_ds_has_dimension_by_key_not_supported
45 #if PHP_VERSION_ID >= 80000
46 (zend_object *obj, zval *offset, int check_empty) {
47 #else
48 (zval *obj, zval *offset, int check_empty) {
49 #endif
50     ARRAY_ACCESS_BY_KEY_NOT_SUPPORTED();
51     return 0;
52 }
53 
54 void php_ds_unset_dimension_by_key_not_supported
55 #if PHP_VERSION_ID >= 80000
56 (zend_object *obj, zval *offset) {
57 #else
58 (zval *obj, zval *offset) {
59 #endif
60     ARRAY_ACCESS_BY_KEY_NOT_SUPPORTED();
61 }
62