Log::channel('single')->debug("blubb " . [1,2,3,4]) does NOTHING. #41979
Replies: 2 comments
-
Hi @Martin-Eckleben your first simple certainly will give you a warning because you are trying to concatenate an array and a string. This is not acceptable. Instead of |
Beta Was this translation helpful? Give feedback.
-
Hi @anabeto93 I think I didn't get the point across correctly.
Correct.
Does not throw a warning. To explain why that can be important: Thank you for your time and effort. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Log::channel('single')->debug("blubb " . [1,2,3,4]);
does NOTHING.
It does not print the blubb neither the array nor a warning nor an empty line neither does it throw an exception etc.
It does exactly nothing.
I thought my code would never reach that place because of a previous error I'd have probably made :D
This is strongly unexpected and malicious behaviour.
I lost about 3h of debugging rn to this :)
Log::channel('single')->debug([1,2,3,4]);
gets prevented by my IDE.
this works:
Log::channel('single')->debug("blubb " . json_encode([1,2,3,4]));
Vanilla PHP throws:
Warning: Array to string conversion in /home/user/scripts/code.php on line 2
Thanks everybody for your hard great work!
Beta Was this translation helpful? Give feedback.
All reactions