func.php ➔ mb_orig_strpos()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
nop 3
1
<?php
2
if (PHP_SAPI !== 'cli') {
3
    return;
4
}
5
6
if (!function_exists('mb_orig_substr')) {
7
    function mb_orig_substr(...$args)
8
    {
9
        return substr(...$args);
10
    }
11
12
    function mb_orig_strrpos(...$args)
13
    {
14
        return strrpos(...$args);
15
    }
16
17
    /**
18
     * @param string $haystack
19
     * @param mixed $needle
20
     * @param int $offset
21
     * @return bool|int
22
     */
23
    function mb_orig_strpos($haystack, $needle, $offset = 0)
24
    {
25
        return strpos($haystack, $needle, $offset);
26
    }
27
28
    /**
29
     * @param string $input
30
     * @return int
31
     */
32
    function mb_orig_strlen($input)
33
    {
34
        return strlen($input);
35
    }
36
}
37
38
if (!function_exists('D')) {
39
    function D(...$args)
40
    {
41
        \PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::dump(...$args));
42
        //\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::backtrace());
43
    }
44
}
45
if (!function_exists('igbinary_serialize')) {
46
    function igbinary_serialize($m)
47
    {
48
        return serialize($m);
49
    }
50
51
    function igbinary_unserialize($m)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
52
    {
53
        return unserialize($m);
54
    }
55
}
56
if (!function_exists('setTimeout')) {
57
    function setTimeout($cb, $timeout = null, $id = null, $priority = null)
58
    {
59
        return \PHPDaemon\Core\Timer::add($cb, $timeout, $id, $priority);
60
    }
61
}
62
if (!function_exists('clearTimeout')) {
63
    function clearTimeout($id)
64
    {
65
        \PHPDaemon\Core\Timer::remove($id);
66
    }
67
}
68