Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
php-7.4.33 /
Zend /
Delete
Unzip
Name
Size
Permission
Date
Action
.libs
[ DIR ]
drwxr-xr-x
2024-03-12 14:35
tests
[ DIR ]
drwxrwxr-x
2022-10-31 11:36
LICENSE
2.74
KB
-rw-rw-r--
2022-10-31 11:36
Makefile.frag
1.96
KB
-rw-rw-r--
2022-10-31 11:36
README.md
4.5
KB
-rw-rw-r--
2022-10-31 11:36
Zend.m4
13.84
KB
-rw-rw-r--
2022-10-31 11:36
bench.php
7.46
KB
-rw-rw-r--
2022-10-31 11:36
micro_bench.php
7.06
KB
-rw-rw-r--
2022-10-31 11:36
zend.c
49.6
KB
-rw-rw-r--
2022-10-31 11:36
zend.h
13.59
KB
-rw-rw-r--
2022-10-31 11:36
zend.lo
308
B
-rw-r--r--
2024-03-12 14:34
zend.o
258.71
KB
-rw-r--r--
2024-03-12 14:34
zend_API.c
129.43
KB
-rw-rw-r--
2022-10-31 11:36
zend_API.h
69.44
KB
-rw-rw-r--
2022-10-31 11:36
zend_API.lo
320
B
-rw-r--r--
2024-03-12 14:34
zend_API.o
802.77
KB
-rw-r--r--
2024-03-12 14:34
zend_alloc.c
89.53
KB
-rw-rw-r--
2022-10-31 11:36
zend_alloc.h
18.76
KB
-rw-rw-r--
2022-10-31 11:36
zend_alloc.lo
326
B
-rw-r--r--
2024-03-12 14:33
zend_alloc.o
533.58
KB
-rw-r--r--
2024-03-12 14:33
zend_alloc_sizes.h
2.57
KB
-rw-rw-r--
2022-10-31 11:36
zend_arena.h
5.93
KB
-rw-rw-r--
2022-10-31 11:36
zend_ast.c
58.76
KB
-rw-rw-r--
2022-10-31 11:36
zend_ast.h
11.42
KB
-rw-rw-r--
2022-10-31 11:36
zend_ast.lo
320
B
-rw-r--r--
2024-03-12 14:34
zend_ast.o
567.83
KB
-rw-r--r--
2024-03-12 14:34
zend_bitset.h
6.72
KB
-rw-rw-r--
2022-10-31 11:36
zend_build.h
1.59
KB
-rw-rw-r--
2022-10-31 11:36
zend_builtin_functions.c
73.69
KB
-rw-rw-r--
2022-10-31 11:36
zend_builtin_functions.h
1.47
KB
-rw-rw-r--
2022-10-31 11:36
zend_builtin_functions.lo
362
B
-rw-r--r--
2024-03-12 14:34
zend_builtin_functions.o
340.98
KB
-rw-r--r--
2024-03-12 14:34
zend_closures.c
26.62
KB
-rw-rw-r--
2022-10-31 11:36
zend_closures.h
2.16
KB
-rw-rw-r--
2022-10-31 11:36
zend_closures.lo
335
B
-rw-r--r--
2024-03-12 14:34
zend_closures.o
146.15
KB
-rw-r--r--
2024-03-12 14:34
zend_compile.c
261.93
KB
-rw-rw-r--
2022-10-31 11:36
zend_compile.h
42.62
KB
-rw-rw-r--
2022-10-31 11:36
zend_compile.lo
332
B
-rw-r--r--
2024-03-12 14:33
zend_compile.o
1.14
MB
-rw-r--r--
2024-03-12 14:33
zend_config.h
32
B
-rw-r--r--
2024-03-12 14:19
zend_config.w32.h
2.55
KB
-rw-rw-r--
2022-10-31 11:36
zend_constants.c
17.19
KB
-rw-rw-r--
2022-10-31 11:36
zend_constants.h
6.15
KB
-rw-rw-r--
2022-10-31 11:36
zend_constants.lo
338
B
-rw-r--r--
2024-03-12 14:33
zend_constants.o
106.83
KB
-rw-r--r--
2024-03-12 14:33
zend_cpuinfo.c
4.46
KB
-rw-rw-r--
2022-10-31 11:36
zend_cpuinfo.h
7.06
KB
-rw-rw-r--
2022-10-31 11:36
zend_cpuinfo.lo
332
B
-rw-r--r--
2024-03-12 14:34
zend_cpuinfo.o
35.52
KB
-rw-r--r--
2024-03-12 14:34
zend_default_classes.c
1.64
KB
-rw-rw-r--
2022-10-31 11:36
zend_default_classes.lo
356
B
-rw-r--r--
2024-03-12 14:34
zend_default_classes.o
52.27
KB
-rw-r--r--
2024-03-12 14:34
zend_dtrace.c
3.99
KB
-rw-rw-r--
2022-10-31 11:36
zend_dtrace.d
2.13
KB
-rw-rw-r--
2022-10-31 11:36
zend_dtrace.h
1.89
KB
-rw-rw-r--
2022-10-31 11:36
zend_dtrace.lo
329
B
-rw-r--r--
2024-03-12 14:33
zend_dtrace.o
49.02
KB
-rw-r--r--
2024-03-12 14:33
zend_errors.h
2
KB
-rw-rw-r--
2022-10-31 11:36
zend_exceptions.c
33.99
KB
-rw-rw-r--
2022-10-31 11:36
zend_exceptions.h
3.76
KB
-rw-rw-r--
2022-10-31 11:36
zend_exceptions.lo
341
B
-rw-r--r--
2024-03-12 14:34
zend_exceptions.o
329.01
KB
-rw-r--r--
2024-03-12 14:34
zend_execute.c
145.48
KB
-rw-rw-r--
2022-10-31 11:36
zend_execute.h
16.53
KB
-rw-rw-r--
2022-10-31 11:36
zend_execute.lo
332
B
-rw-r--r--
2024-03-12 14:35
zend_execute.o
5.96
MB
-rw-r--r--
2024-03-12 14:35
zend_execute_API.c
46.12
KB
-rw-rw-r--
2022-10-31 11:36
zend_execute_API.lo
344
B
-rw-r--r--
2024-03-12 14:33
zend_execute_API.o
245.2
KB
-rw-r--r--
2024-03-12 14:33
zend_extensions.c
9.94
KB
-rw-rw-r--
2022-10-31 11:36
zend_extensions.h
5.93
KB
-rw-rw-r--
2022-10-31 11:36
zend_extensions.lo
341
B
-rw-r--r--
2024-03-12 14:34
zend_extensions.o
71.02
KB
-rw-r--r--
2024-03-12 14:34
zend_float.c
1.75
KB
-rw-rw-r--
2022-10-31 11:36
zend_float.h
15.08
KB
-rw-rw-r--
2022-10-31 11:36
zend_float.lo
326
B
-rw-r--r--
2024-03-12 14:34
zend_float.o
48.54
KB
-rw-r--r--
2024-03-12 14:34
zend_gc.c
39.12
KB
-rw-rw-r--
2022-10-31 11:36
zend_gc.h
2.8
KB
-rw-rw-r--
2022-10-31 11:36
zend_gc.lo
317
B
-rw-r--r--
2024-03-12 14:34
zend_gc.o
111.8
KB
-rw-r--r--
2024-03-12 14:34
zend_generators.c
37.91
KB
-rw-rw-r--
2022-10-31 11:36
zend_generators.h
7.18
KB
-rw-rw-r--
2022-10-31 11:36
zend_generators.lo
341
B
-rw-r--r--
2024-03-12 14:34
zend_generators.o
227.82
KB
-rw-r--r--
2024-03-12 14:34
zend_globals.h
7.58
KB
-rw-rw-r--
2022-10-31 11:36
zend_globals_macros.h
2.74
KB
-rw-rw-r--
2022-10-31 11:36
zend_hash.c
70.2
KB
-rw-rw-r--
2022-10-31 11:36
zend_hash.h
35.58
KB
-rw-rw-r--
2022-10-31 11:36
zend_hash.lo
323
B
-rw-r--r--
2024-03-12 14:34
zend_hash.o
358.47
KB
-rw-r--r--
2024-03-12 14:34
zend_highlight.c
5.77
KB
-rw-rw-r--
2022-10-31 11:36
zend_highlight.h
2.21
KB
-rw-rw-r--
2022-10-31 11:36
zend_highlight.lo
338
B
-rw-r--r--
2024-03-12 14:33
zend_highlight.o
66.79
KB
-rw-r--r--
2024-03-12 14:33
zend_inheritance.c
90.02
KB
-rw-rw-r--
2022-10-31 11:36
zend_inheritance.h
1.98
KB
-rw-rw-r--
2022-10-31 11:36
zend_inheritance.lo
344
B
-rw-r--r--
2024-03-12 14:34
zend_inheritance.o
434.91
KB
-rw-r--r--
2024-03-12 14:34
zend_ini.c
17.4
KB
-rw-rw-r--
2022-10-31 11:36
zend_ini.h
9.59
KB
-rw-rw-r--
2022-10-31 11:36
zend_ini.lo
320
B
-rw-r--r--
2024-03-12 14:34
zend_ini.o
132.13
KB
-rw-r--r--
2024-03-12 14:34
zend_ini_parser.c
60.95
KB
-rw-r--r--
2022-10-31 11:36
zend_ini_parser.h
2.34
KB
-rw-r--r--
2022-10-31 11:36
zend_ini_parser.lo
341
B
-rw-r--r--
2024-03-12 14:33
zend_ini_parser.o
171.41
KB
-rw-r--r--
2024-03-12 14:33
zend_ini_parser.output
20.91
KB
-rw-r--r--
2022-10-31 11:36
zend_ini_parser.y
11.79
KB
-rw-rw-r--
2022-10-31 11:36
zend_ini_scanner.c
100.26
KB
-rw-r--r--
2022-10-31 11:36
zend_ini_scanner.h
1.83
KB
-rw-rw-r--
2022-10-31 11:36
zend_ini_scanner.l
16.77
KB
-rw-rw-r--
2022-10-31 11:36
zend_ini_scanner.lo
344
B
-rw-r--r--
2024-03-12 14:33
zend_ini_scanner.o
239.65
KB
-rw-r--r--
2024-03-12 14:33
zend_ini_scanner_defs.h
187
B
-rw-r--r--
2022-10-31 11:36
zend_interfaces.c
19.22
KB
-rw-rw-r--
2022-10-31 11:36
zend_interfaces.h
4.17
KB
-rw-rw-r--
2022-10-31 11:36
zend_interfaces.lo
341
B
-rw-r--r--
2024-03-12 14:34
zend_interfaces.o
107.88
KB
-rw-r--r--
2024-03-12 14:34
zend_istdiostream.h
1.5
KB
-rw-rw-r--
2022-10-31 11:36
zend_iterators.c
3.13
KB
-rw-rw-r--
2022-10-31 11:36
zend_iterators.h
3.32
KB
-rw-rw-r--
2022-10-31 11:36
zend_iterators.lo
338
B
-rw-r--r--
2024-03-12 14:34
zend_iterators.o
53.67
KB
-rw-r--r--
2024-03-12 14:34
zend_language_parser.c
246.84
KB
-rw-r--r--
2022-10-31 11:36
zend_language_parser.h
4.98
KB
-rw-r--r--
2022-10-31 11:36
zend_language_parser.lo
356
B
-rw-r--r--
2024-03-12 14:33
zend_language_parser.o
372.22
KB
-rw-r--r--
2024-03-12 14:33
zend_language_parser.output
1.29
MB
-rw-r--r--
2022-10-31 11:36
zend_language_parser.y
48.11
KB
-rw-rw-r--
2022-10-31 11:36
zend_language_scanner.c
194.82
KB
-rw-r--r--
2024-03-12 14:32
zend_language_scanner.h
2.67
KB
-rw-rw-r--
2022-10-31 11:36
zend_language_scanner.l
68.12
KB
-rw-rw-r--
2022-10-31 11:36
zend_language_scanner.lo
359
B
-rw-r--r--
2024-03-12 14:33
zend_language_scanner.o
477.44
KB
-rw-r--r--
2024-03-12 14:33
zend_language_scanner_defs.h
309
B
-rw-r--r--
2024-03-12 14:32
zend_list.c
9.12
KB
-rw-rw-r--
2022-10-31 11:36
zend_list.h
3.39
KB
-rw-rw-r--
2022-10-31 11:36
zend_list.lo
323
B
-rw-r--r--
2024-03-12 14:34
zend_list.o
82.94
KB
-rw-r--r--
2024-03-12 14:34
zend_llist.c
6.68
KB
-rw-rw-r--
2022-10-31 11:36
zend_llist.h
3.7
KB
-rw-rw-r--
2022-10-31 11:36
zend_llist.lo
326
B
-rw-r--r--
2024-03-12 14:33
zend_llist.o
45.31
KB
-rw-r--r--
2024-03-12 14:33
zend_long.h
4.2
KB
-rw-rw-r--
2022-10-31 11:36
zend_map_ptr.h
3.09
KB
-rw-rw-r--
2022-10-31 11:36
zend_modules.h
4.68
KB
-rw-rw-r--
2022-10-31 11:36
zend_multibyte.c
7.15
KB
-rw-rw-r--
2022-10-31 11:36
zend_multibyte.h
4.75
KB
-rw-rw-r--
2022-10-31 11:36
zend_multibyte.lo
338
B
-rw-r--r--
2024-03-12 14:34
zend_multibyte.o
68.26
KB
-rw-r--r--
2024-03-12 14:34
zend_multiply.h
9.61
KB
-rw-rw-r--
2022-10-31 11:36
zend_object_handlers.c
56.61
KB
-rw-rw-r--
2022-10-31 11:36
zend_object_handlers.h
13.19
KB
-rw-rw-r--
2022-10-31 11:36
zend_object_handlers.lo
356
B
-rw-r--r--
2024-03-12 14:34
zend_object_handlers.o
320.37
KB
-rw-r--r--
2024-03-12 14:34
zend_objects.c
9.55
KB
-rw-rw-r--
2022-10-31 11:36
zend_objects.h
1.76
KB
-rw-rw-r--
2022-10-31 11:36
zend_objects.lo
332
B
-rw-r--r--
2024-03-12 14:34
zend_objects.o
76.55
KB
-rw-r--r--
2024-03-12 14:34
zend_objects_API.c
6.57
KB
-rw-rw-r--
2022-10-31 11:36
zend_objects_API.h
4.57
KB
-rw-rw-r--
2022-10-31 11:36
zend_objects_API.lo
344
B
-rw-r--r--
2024-03-12 14:34
zend_objects_API.o
61.74
KB
-rw-r--r--
2024-03-12 14:34
zend_opcode.c
33.24
KB
-rw-rw-r--
2022-10-31 11:36
zend_opcode.lo
329
B
-rw-r--r--
2024-03-12 14:33
zend_opcode.o
127.59
KB
-rw-r--r--
2024-03-12 14:33
zend_operators.c
81.41
KB
-rw-rw-r--
2022-10-31 11:36
zend_operators.h
33.35
KB
-rw-rw-r--
2022-10-31 11:36
zend_operators.lo
338
B
-rw-r--r--
2024-03-12 14:33
zend_operators.o
517.25
KB
-rw-r--r--
2024-03-12 14:33
zend_portability.h
19.67
KB
-rw-rw-r--
2022-10-31 11:36
zend_ptr_stack.c
2.96
KB
-rw-rw-r--
2022-10-31 11:36
zend_ptr_stack.h
4.21
KB
-rw-rw-r--
2022-10-31 11:36
zend_ptr_stack.lo
338
B
-rw-r--r--
2024-03-12 14:33
zend_ptr_stack.o
35.73
KB
-rw-r--r--
2024-03-12 14:33
zend_range_check.h
2.93
KB
-rw-rw-r--
2022-10-31 11:36
zend_signal.c
12.73
KB
-rw-rw-r--
2022-10-31 11:36
zend_signal.h
3.99
KB
-rw-rw-r--
2022-10-31 11:36
zend_signal.lo
329
B
-rw-r--r--
2024-03-12 14:34
zend_signal.o
68.41
KB
-rw-r--r--
2024-03-12 14:34
zend_smart_str.c
5.54
KB
-rw-rw-r--
2022-10-31 11:36
zend_smart_str.h
5.4
KB
-rw-rw-r--
2022-10-31 11:36
zend_smart_str.lo
338
B
-rw-r--r--
2024-03-12 14:34
zend_smart_str.o
60.2
KB
-rw-r--r--
2024-03-12 14:34
zend_smart_str_public.h
1.25
KB
-rw-rw-r--
2022-10-31 11:36
zend_smart_string.h
4.29
KB
-rw-rw-r--
2022-10-31 11:36
zend_smart_string_public.h
1.36
KB
-rw-rw-r--
2022-10-31 11:36
zend_sort.c
10.6
KB
-rw-rw-r--
2022-10-31 11:36
zend_sort.h
1.6
KB
-rw-rw-r--
2022-10-31 11:36
zend_sort.lo
323
B
-rw-r--r--
2024-03-12 14:34
zend_sort.o
51.37
KB
-rw-r--r--
2024-03-12 14:34
zend_stack.c
3.89
KB
-rw-rw-r--
2022-10-31 11:36
zend_stack.h
2.3
KB
-rw-rw-r--
2022-10-31 11:36
zend_stack.lo
326
B
-rw-r--r--
2024-03-12 14:33
zend_stack.o
36.35
KB
-rw-r--r--
2024-03-12 14:33
zend_stream.c
7.04
KB
-rw-rw-r--
2022-10-31 11:36
zend_stream.h
3.46
KB
-rw-rw-r--
2022-10-31 11:36
zend_stream.lo
329
B
-rw-r--r--
2024-03-12 14:34
zend_stream.o
64.43
KB
-rw-r--r--
2024-03-12 14:34
zend_string.c
12.44
KB
-rw-rw-r--
2022-10-31 11:36
zend_string.h
17.06
KB
-rw-rw-r--
2022-10-31 11:36
zend_string.lo
329
B
-rw-r--r--
2024-03-12 14:34
zend_string.o
90.5
KB
-rw-r--r--
2024-03-12 14:34
zend_strtod.c
90.48
KB
-rw-rw-r--
2022-10-31 11:36
zend_strtod.h
1.81
KB
-rw-rw-r--
2022-10-31 11:36
zend_strtod.lo
329
B
-rw-r--r--
2024-03-12 14:34
zend_strtod.o
152.94
KB
-rw-r--r--
2024-03-12 14:34
zend_strtod_int.h
3.42
KB
-rw-rw-r--
2022-10-31 11:36
zend_ts_hash.c
7.98
KB
-rw-rw-r--
2022-10-31 11:36
zend_ts_hash.h
5.6
KB
-rw-rw-r--
2022-10-31 11:36
zend_ts_hash.lo
332
B
-rw-r--r--
2024-03-12 14:34
zend_ts_hash.o
50.75
KB
-rw-r--r--
2024-03-12 14:34
zend_type_info.h
3.02
KB
-rw-rw-r--
2022-10-31 11:36
zend_types.h
39.58
KB
-rw-rw-r--
2022-10-31 11:36
zend_variables.c
4.63
KB
-rw-rw-r--
2022-10-31 11:36
zend_variables.h
3.2
KB
-rw-rw-r--
2022-10-31 11:36
zend_variables.lo
338
B
-rw-r--r--
2024-03-12 14:33
zend_variables.o
60.51
KB
-rw-r--r--
2024-03-12 14:33
zend_virtual_cwd.c
42.65
KB
-rw-rw-r--
2022-10-31 11:36
zend_virtual_cwd.h
12.44
KB
-rw-rw-r--
2022-10-31 11:36
zend_virtual_cwd.lo
344
B
-rw-r--r--
2024-03-12 14:34
zend_virtual_cwd.o
102.16
KB
-rw-r--r--
2024-03-12 14:34
zend_vm.h
1.91
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_def.h
264.93
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_execute.h
1.92
MB
-rw-rw-r--
2022-10-31 11:36
zend_vm_execute.skl
3.53
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_gen.php
142.79
KB
-rwxrwxr-x
2022-10-31 11:36
zend_vm_handlers.h
85.91
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_opcodes.c
8.32
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_opcodes.h
11.8
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_opcodes.lo
341
B
-rw-r--r--
2024-03-12 14:33
zend_vm_opcodes.o
40.12
KB
-rw-r--r--
2024-03-12 14:33
zend_vm_trace_handlers.h
3.14
KB
-rw-rw-r--
2022-10-31 11:36
zend_vm_trace_map.h
2.59
KB
-rw-rw-r--
2022-10-31 11:36
zend_weakrefs.c
6.42
KB
-rw-rw-r--
2022-10-31 11:36
zend_weakrefs.h
1.41
KB
-rw-rw-r--
2022-10-31 11:36
zend_weakrefs.lo
335
B
-rw-r--r--
2024-03-12 14:34
zend_weakrefs.o
82.87
KB
-rw-r--r--
2024-03-12 14:34
Save
Rename
/* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ */ #include "zend.h" #include "zend_API.h" #include "zend_interfaces.h" #include "zend_exceptions.h" ZEND_API zend_class_entry *zend_ce_traversable; ZEND_API zend_class_entry *zend_ce_aggregate; ZEND_API zend_class_entry *zend_ce_iterator; ZEND_API zend_class_entry *zend_ce_arrayaccess; ZEND_API zend_class_entry *zend_ce_serializable; ZEND_API zend_class_entry *zend_ce_countable; /* {{{ zend_call_method Only returns the returned zval if retval_ptr != NULL */ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval_ptr, int param_count, zval* arg1, zval* arg2) { int result; zend_fcall_info fci; zval retval; zval params[2]; if (param_count > 0) { ZVAL_COPY_VALUE(¶ms[0], arg1); } if (param_count > 1) { ZVAL_COPY_VALUE(¶ms[1], arg2); } fci.size = sizeof(fci); fci.object = object ? Z_OBJ_P(object) : NULL; fci.retval = retval_ptr ? retval_ptr : &retval; fci.param_count = param_count; fci.params = params; fci.no_separation = 1; if (!fn_proxy && !obj_ce) { /* no interest in caching and no information already present that is * needed later inside zend_call_function. */ ZVAL_STRINGL(&fci.function_name, function_name, function_name_len); result = zend_call_function(&fci, NULL); zval_ptr_dtor(&fci.function_name); } else { zend_fcall_info_cache fcic; ZVAL_UNDEF(&fci.function_name); /* Unused */ if (!obj_ce) { obj_ce = object ? Z_OBJCE_P(object) : NULL; } if (!fn_proxy || !*fn_proxy) { if (EXPECTED(obj_ce)) { fcic.function_handler = zend_hash_str_find_ptr( &obj_ce->function_table, function_name, function_name_len); if (UNEXPECTED(fcic.function_handler == NULL)) { /* error at c-level */ zend_error_noreturn(E_CORE_ERROR, "Couldn't find implementation for method %s::%s", ZSTR_VAL(obj_ce->name), function_name); } } else { fcic.function_handler = zend_fetch_function_str(function_name, function_name_len); if (UNEXPECTED(fcic.function_handler == NULL)) { /* error at c-level */ zend_error_noreturn(E_CORE_ERROR, "Couldn't find implementation for function %s", function_name); } } if (fn_proxy) { *fn_proxy = fcic.function_handler; } } else { fcic.function_handler = *fn_proxy; } if (object) { fcic.called_scope = Z_OBJCE_P(object); } else { zend_class_entry *called_scope = zend_get_called_scope(EG(current_execute_data)); if (obj_ce && (!called_scope || !instanceof_function(called_scope, obj_ce))) { fcic.called_scope = obj_ce; } else { fcic.called_scope = called_scope; } } fcic.object = object ? Z_OBJ_P(object) : NULL; result = zend_call_function(&fci, &fcic); } if (result == FAILURE) { /* error at c-level */ if (!obj_ce) { obj_ce = object ? Z_OBJCE_P(object) : NULL; } if (!EG(exception)) { zend_error_noreturn(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? ZSTR_VAL(obj_ce->name) : "", obj_ce ? "::" : "", function_name); } } if (!retval_ptr) { zval_ptr_dtor(&retval); return NULL; } return retval_ptr; } /* }}} */ /* iterator interface, c-level functions used by engine */ /* {{{ zend_user_it_new_iterator */ ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *retval) { zend_call_method_with_0_params(object, ce, &ce->iterator_funcs_ptr->zf_new_iterator, "getiterator", retval); } /* }}} */ /* {{{ zend_user_it_invalidate_current */ ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; if (!Z_ISUNDEF(iter->value)) { zval_ptr_dtor(&iter->value); ZVAL_UNDEF(&iter->value); } } /* }}} */ /* {{{ zend_user_it_dtor */ static void zend_user_it_dtor(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; zend_user_it_invalidate_current(_iter); zval_ptr_dtor(object); } /* }}} */ /* {{{ zend_user_it_valid */ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter) { if (_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; zval more; int result; zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_valid, "valid", &more); result = i_zend_is_true(&more); zval_ptr_dtor(&more); return result ? SUCCESS : FAILURE; } return FAILURE; } /* }}} */ /* {{{ zend_user_it_get_current_data */ ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; if (Z_ISUNDEF(iter->value)) { zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_current, "current", &iter->value); } return &iter->value; } /* }}} */ /* {{{ zend_user_it_get_current_key */ ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key) { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; zval retval; zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", &retval); if (Z_TYPE(retval) != IS_UNDEF) { ZVAL_ZVAL(key, &retval, 1, 1); } else { if (!EG(exception)) { zend_error(E_WARNING, "Nothing returned from %s::key()", ZSTR_VAL(iter->ce->name)); } ZVAL_LONG(key, 0); } } /* }}} */ /* {{{ zend_user_it_move_forward */ ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; zend_user_it_invalidate_current(_iter); zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_next, "next", NULL); } /* }}} */ /* {{{ zend_user_it_rewind */ ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; zend_user_it_invalidate_current(_iter); zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_rewind, "rewind", NULL); } /* }}} */ static const zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = { zend_user_it_dtor, zend_user_it_valid, zend_user_it_get_current_data, zend_user_it_get_current_key, zend_user_it_move_forward, zend_user_it_rewind, zend_user_it_invalidate_current }; /* {{{ zend_user_it_get_iterator */ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref) { zend_user_iterator *iterator; if (by_ref) { zend_throw_error(NULL, "An iterator cannot be used with foreach by reference"); return NULL; } iterator = emalloc(sizeof(zend_user_iterator)); zend_iterator_init((zend_object_iterator*)iterator); Z_ADDREF_P(object); ZVAL_OBJ(&iterator->it.data, Z_OBJ_P(object)); iterator->it.funcs = &zend_interface_iterator_funcs_iterator; iterator->ce = Z_OBJCE_P(object); ZVAL_UNDEF(&iterator->value); return (zend_object_iterator*)iterator; } /* }}} */ /* {{{ zend_user_it_get_new_iterator */ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref) { zval iterator; zend_object_iterator *new_iterator; zend_class_entry *ce_it; zend_user_it_new_iterator(ce, object, &iterator); ce_it = (Z_TYPE(iterator) == IS_OBJECT) ? Z_OBJCE(iterator) : NULL; if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && Z_OBJ(iterator) == Z_OBJ_P(object))) { if (!EG(exception)) { zend_throw_exception_ex(NULL, 0, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ZSTR_VAL(ce->name) : ZSTR_VAL(Z_OBJCE_P(object)->name)); } zval_ptr_dtor(&iterator); return NULL; } new_iterator = ce_it->get_iterator(ce_it, &iterator, by_ref); zval_ptr_dtor(&iterator); return new_iterator; } /* }}} */ /* {{{ zend_implement_traversable */ static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type) { /* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */ uint32_t i; if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) { return SUCCESS; } if (class_type->num_interfaces) { ZEND_ASSERT(class_type->ce_flags & ZEND_ACC_RESOLVED_INTERFACES); for (i = 0; i < class_type->num_interfaces; i++) { if (class_type->interfaces[i] == zend_ce_aggregate || class_type->interfaces[i] == zend_ce_iterator) { return SUCCESS; } } } zend_error_noreturn(E_CORE_ERROR, "Class %s must implement interface %s as part of either %s or %s", ZSTR_VAL(class_type->name), ZSTR_VAL(zend_ce_traversable->name), ZSTR_VAL(zend_ce_iterator->name), ZSTR_VAL(zend_ce_aggregate->name)); return FAILURE; } /* }}} */ /* {{{ zend_implement_aggregate */ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type) { uint32_t i; int t = -1; zend_class_iterator_funcs *funcs_ptr; if (class_type->get_iterator) { if (class_type->type == ZEND_INTERNAL_CLASS) { /* inheritance ensures the class has necessary userland methods */ return SUCCESS; } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { /* c-level get_iterator cannot be changed (exception being only Traversable is implemented) */ if (class_type->num_interfaces) { ZEND_ASSERT(class_type->ce_flags & ZEND_ACC_RESOLVED_INTERFACES); for (i = 0; i < class_type->num_interfaces; i++) { if (class_type->interfaces[i] == zend_ce_iterator) { zend_error_noreturn(E_ERROR, "Class %s cannot implement both %s and %s at the same time", ZSTR_VAL(class_type->name), ZSTR_VAL(interface->name), ZSTR_VAL(zend_ce_iterator->name)); return FAILURE; } if (class_type->interfaces[i] == zend_ce_traversable) { t = i; } } } if (t == -1) { return FAILURE; } } } if (class_type->parent && (class_type->parent->ce_flags & ZEND_ACC_REUSE_GET_ITERATOR)) { class_type->get_iterator = class_type->parent->get_iterator; class_type->ce_flags |= ZEND_ACC_REUSE_GET_ITERATOR; } else { class_type->get_iterator = zend_user_it_get_new_iterator; } funcs_ptr = class_type->iterator_funcs_ptr; if (class_type->type == ZEND_INTERNAL_CLASS) { if (!funcs_ptr) { funcs_ptr = calloc(1, sizeof(zend_class_iterator_funcs)); class_type->iterator_funcs_ptr = funcs_ptr; } funcs_ptr->zf_new_iterator = zend_hash_str_find_ptr(&class_type->function_table, "getiterator", sizeof("getiterator") - 1); } else { if (!funcs_ptr) { funcs_ptr = zend_arena_alloc(&CG(arena), sizeof(zend_class_iterator_funcs)); class_type->iterator_funcs_ptr = funcs_ptr; memset(funcs_ptr, 0, sizeof(zend_class_iterator_funcs)); } else { funcs_ptr->zf_new_iterator = NULL; } } return SUCCESS; } /* }}} */ /* {{{ zend_implement_iterator */ static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type) { zend_class_iterator_funcs *funcs_ptr; if (class_type->get_iterator && class_type->get_iterator != zend_user_it_get_iterator) { if (class_type->type == ZEND_INTERNAL_CLASS) { /* inheritance ensures the class has the necessary userland methods */ return SUCCESS; } else { /* c-level get_iterator cannot be changed */ if (class_type->get_iterator == zend_user_it_get_new_iterator) { zend_error_noreturn(E_ERROR, "Class %s cannot implement both %s and %s at the same time", ZSTR_VAL(class_type->name), ZSTR_VAL(interface->name), ZSTR_VAL(zend_ce_aggregate->name)); } return FAILURE; } } if (class_type->parent && (class_type->parent->ce_flags & ZEND_ACC_REUSE_GET_ITERATOR)) { class_type->get_iterator = class_type->parent->get_iterator; class_type->ce_flags |= ZEND_ACC_REUSE_GET_ITERATOR; } else { class_type->get_iterator = zend_user_it_get_iterator; } funcs_ptr = class_type->iterator_funcs_ptr; if (class_type->type == ZEND_INTERNAL_CLASS) { if (!funcs_ptr) { funcs_ptr = calloc(1, sizeof(zend_class_iterator_funcs)); class_type->iterator_funcs_ptr = funcs_ptr; } else { funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1); funcs_ptr->zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1); funcs_ptr->zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1); funcs_ptr->zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1); funcs_ptr->zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1); } } else { if (!funcs_ptr) { funcs_ptr = zend_arena_alloc(&CG(arena), sizeof(zend_class_iterator_funcs)); class_type->iterator_funcs_ptr = funcs_ptr; memset(funcs_ptr, 0, sizeof(zend_class_iterator_funcs)); } else { funcs_ptr->zf_valid = NULL; funcs_ptr->zf_current = NULL; funcs_ptr->zf_key = NULL; funcs_ptr->zf_next = NULL; funcs_ptr->zf_rewind = NULL; } } return SUCCESS; } /* }}} */ /* {{{ zend_implement_arrayaccess */ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type) { return SUCCESS; } /* }}}*/ /* {{{ zend_user_serialize */ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) { zend_class_entry * ce = Z_OBJCE_P(object); zval retval; int result; zend_call_method_with_0_params(object, ce, &ce->serialize_func, "serialize", &retval); if (Z_TYPE(retval) == IS_UNDEF || EG(exception)) { result = FAILURE; } else { switch(Z_TYPE(retval)) { case IS_NULL: /* we could also make this '*buf_len = 0' but this allows to skip variables */ zval_ptr_dtor(&retval); return FAILURE; case IS_STRING: *buffer = (unsigned char*)estrndup(Z_STRVAL(retval), Z_STRLEN(retval)); *buf_len = Z_STRLEN(retval); result = SUCCESS; break; default: /* failure */ result = FAILURE; break; } zval_ptr_dtor(&retval); } if (result == FAILURE && !EG(exception)) { zend_throw_exception_ex(NULL, 0, "%s::serialize() must return a string or NULL", ZSTR_VAL(ce->name)); } return result; } /* }}} */ /* {{{ zend_user_unserialize */ ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) { zval zdata; if (UNEXPECTED(object_init_ex(object, ce) != SUCCESS)) { return FAILURE; } ZVAL_STRINGL(&zdata, (char*)buf, buf_len); zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, &zdata); zval_ptr_dtor(&zdata); if (EG(exception)) { return FAILURE; } else { return SUCCESS; } } /* }}} */ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(object); zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed", ZSTR_VAL(ce->name)); return FAILURE; } /* }}} */ ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) /* {{{ */ { zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed", ZSTR_VAL(ce->name)); return FAILURE; } /* }}} */ /* {{{ zend_implement_serializable */ static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type) { if (class_type->parent && (class_type->parent->serialize || class_type->parent->unserialize) && !instanceof_function_ex(class_type->parent, zend_ce_serializable, 1)) { return FAILURE; } if (!class_type->serialize) { class_type->serialize = zend_user_serialize; } if (!class_type->unserialize) { class_type->unserialize = zend_user_unserialize; } return SUCCESS; } /* }}}*/ /* {{{ zend_implement_countable */ static int zend_implement_countable(zend_class_entry *interface, zend_class_entry *class_type) { return SUCCESS; } /* }}}*/ /* {{{ function tables */ static const zend_function_entry zend_funcs_aggregate[] = { ZEND_ABSTRACT_ME(iterator, getIterator, NULL) ZEND_FE_END }; static const zend_function_entry zend_funcs_iterator[] = { ZEND_ABSTRACT_ME(iterator, current, NULL) ZEND_ABSTRACT_ME(iterator, next, NULL) ZEND_ABSTRACT_ME(iterator, key, NULL) ZEND_ABSTRACT_ME(iterator, valid, NULL) ZEND_ABSTRACT_ME(iterator, rewind, NULL) ZEND_FE_END }; static const zend_function_entry *zend_funcs_traversable = NULL; ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset, 0, 0, 1) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_get, 0, 0, 1) /* actually this should be return by ref but atm cannot be */ ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2) ZEND_ARG_INFO(0, offset) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() static const zend_function_entry zend_funcs_arrayaccess[] = { ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_arrayaccess_offset) ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get) ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) ZEND_FE_END }; ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0) ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() static const zend_function_entry zend_funcs_serializable[] = { ZEND_ABSTRACT_ME(serializable, serialize, NULL) ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) ZEND_FE_END }; ZEND_BEGIN_ARG_INFO(arginfo_countable_count, 0) ZEND_END_ARG_INFO() static const zend_function_entry zend_funcs_countable[] = { ZEND_ABSTRACT_ME(Countable, count, arginfo_countable_count) ZEND_FE_END }; /* }}} */ /* {{{ zend_register_interfaces */ ZEND_API void zend_register_interfaces(void) { REGISTER_MAGIC_INTERFACE(traversable, Traversable); REGISTER_MAGIC_INTERFACE(aggregate, IteratorAggregate); REGISTER_MAGIC_IMPLEMENT(aggregate, traversable); REGISTER_MAGIC_INTERFACE(iterator, Iterator); REGISTER_MAGIC_IMPLEMENT(iterator, traversable); REGISTER_MAGIC_INTERFACE(arrayaccess, ArrayAccess); REGISTER_MAGIC_INTERFACE(serializable, Serializable); REGISTER_MAGIC_INTERFACE(countable, Countable); } /* }}} */