| 1 | <?php |
||
| 11 | class CallFuncMemorySniffer { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var integer |
||
| 15 | */ |
||
| 16 | private static $max; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var integer |
||
| 20 | */ |
||
| 21 | private static $memory; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var integer |
||
| 25 | */ |
||
| 26 | private $time; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @since 2.0 |
||
| 30 | */ |
||
| 31 | public static function memoryTick() { |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @since 2.0 |
||
| 39 | * |
||
| 40 | * @param callable $func |
||
| 41 | * @param array|null $args |
||
| 42 | * |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | public function call( callable $func, $args = null ) { |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @since 2.0 |
||
| 69 | * |
||
| 70 | * @return integer |
||
| 71 | */ |
||
| 72 | public function getMemoryUsed() { |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @since 2.0 |
||
| 78 | * |
||
| 79 | * @return float |
||
| 80 | */ |
||
| 81 | public function getTimeUsed() { |
||
| 84 | |||
| 85 | } |
||
| 86 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.