1 | <?php declare(strict_types=1); |
||
13 | class UrlGenerator |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @param string $host |
||
18 | * @param string $path |
||
19 | * @return string |
||
20 | */ |
||
21 | 6 | public function getAbsolutePath(string $path, string $host = null): string |
|
28 | |||
29 | /** |
||
30 | * @param string $host |
||
31 | * @param string $path |
||
32 | * @return string |
||
33 | */ |
||
34 | 2 | public function generateAbsolutePath(string $host, string $path): string |
|
39 | } |
||
40 |
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: