1 | <?php |
||
17 | class DebuggerTimer |
||
18 | { |
||
19 | /** |
||
20 | * @var TimerPanel |
||
21 | */ |
||
22 | protected $panel; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $name; |
||
28 | |||
29 | /** |
||
30 | * @var float |
||
31 | */ |
||
32 | protected $delta; |
||
33 | |||
34 | /** |
||
35 | * @param TimerPanel|null $panel Debugger timer imer panel |
||
36 | * @param string|null $name Timer name |
||
37 | */ |
||
38 | public function __construct(TimerPanel $panel = null, string $name = null) |
||
43 | |||
44 | /** |
||
45 | * Return delta time |
||
46 | * |
||
47 | * @return float |
||
48 | */ |
||
49 | public function getDelta() : float |
||
53 | |||
54 | /** |
||
55 | * Set timer name |
||
56 | * |
||
57 | * Do not overrides. |
||
58 | * |
||
59 | * @param string|null $name |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function setName(string $name = null) |
||
67 | |||
68 | /** |
||
69 | * Start the timer |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function start() |
||
78 | |||
79 | /** |
||
80 | * Stop the timer |
||
81 | * |
||
82 | * @param string $title Debugger bar timer value title |
||
83 | * @return float Delta time |
||
84 | */ |
||
85 | public function stop(string $title = null) : float |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | public function __toString() |
||
99 | } |
||
100 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: