1<?php
2
3function skipFunction($function): bool {
4    if (false
5        /* expect input / hang */
6     || $function === 'readline'
7     || $function === 'readline_read_history'
8     || $function === 'readline_write_history'
9        /* intentionally violate invariants */
10     || $function === 'zend_create_unterminated_string'
11     || $function === 'zend_test_array_return'
12     || $function === 'zend_leak_bytes'
13        /* mess with output */
14     || (is_string($function) && str_starts_with($function, 'ob_'))
15     || $function === 'output_add_rewrite_var'
16     || $function === 'error_log'
17        /* may spend a lot of time waiting for connection timeouts */
18     || (is_string($function) && str_contains($function, 'connect'))
19     || (is_string($function) && str_starts_with($function, 'snmp'))
20     || (is_array($function) && get_class($function[0]) === mysqli::class
21         && in_array($function[1], ['__construct', 'connect', 'real_connect']))
22        /* misc */
23     || $function === 'mail'
24     || $function === 'mb_send_mail'
25     || $function === 'pcntl_fork'
26     || $function === 'posix_kill'
27     || $function === 'posix_setrlimit'
28     || $function === 'sapi_windows_generate_ctrl_event'
29     || $function === 'imagegrabscreen'
30    ) {
31        return true;
32    }
33    if ($function[0] instanceof SoapServer) {
34        /* TODO: Uses fatal errors */
35        return true;
36    }
37
38    return false;
39}
40