[Question] Boolean values casted to string
See original GitHub issueConsidering the following example code:
route('collector.get-messages', {
body: true,
collector: 1
});
It’s currently (v0.9.4
) rendered as: http://example.com/collector/1/messages?body=true
In PHP it’s considered to be a string, and both "true"
and "false"
strictly equals to the boolean value true
. I think this comes from the qs
dependency stringify()
function, if I want to send a PR, should I send it to this repository, or to qs
?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Boolean.prototype.toString() - JavaScript - MDN Web Docs
The toString() method returns a string representing the specified boolean value.
Read more >Why can we cast bool to str? - python
In the case of str() , it delegates to the __str__ special method if present, which means that bool objects return the strings...
Read more >Python | Ways to convert Boolean values to integer
Given a boolean value(s), write a Python program to convert them into an integer value or list respectively. Given below are a few...
Read more >Java Program to convert boolean to integer
To convert boolean to integer, let us first declare a variable of boolean primitive. boolean bool = true;. Now, to convert it to...
Read more >Logical Data Types - Boolean
Explicit Conversion¶. Boolean values can be cast explicitly to string or numeric values. String Conversion. TRUE is converted to 'true'.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If Laravel’s route didn’t change Boolean values to an int, I would have been surprised ^^’
I would happily submit a PR, I will to read about encoders on
qs
and submit something.Thanks for the debate
No worries! I got it working, it’ll be included in v1.