$iterator = 1;
foreach($inputs as $input) {
echo "\n-- Iteration $iterator --\n";
- var_dump(bindec($input));
+ try {
+ var_dump(bindec($input));
+ } catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+ }
$iterator++;
};
fclose($fp);
int(0)
-- Iteration 18 --
-
-Notice: Array to string conversion in %s on line %d
-int(0)
+bindec() expects parameter 1 to be string, array given
-- Iteration 19 --
int(0)
int(0)
-- Iteration 24 --
-int(%d)
+bindec() expects parameter 1 to be string, resource given
===Done===
$iterator = 1;
foreach($inputs as $input) {
echo "\n-- Iteration $iterator --\n";
- var_dump(hexdec($input));
+ try {
+ var_dump(hexdec($input));
+ } catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+ }
$iterator++;
};
fclose($fp);
int(0)
-- Iteration 20 --
-
-Notice: Array to string conversion in %s on line %d
-int(170)
+hexdec() expects parameter 1 to be string, array given
-- Iteration 21 --
int(2748)
int(0)
-- Iteration 26 --
-%s
+hexdec() expects parameter 1 to be string, resource given
===Done===