Commit 54900d2
committed
allow urlencode(int)
in strict mode it's kindof annoying to have to cast-to-string when you have a string|int variable you need to urlencode.
There is no ambiguity as to how to urlencode integers, so it shouldn't be a problem.
"TypeError: urlencode(): Argument #1 ($string) must be of type string, int given"
Has happened to me enough times now that I bothered to make PR to allow it.
Fwiw the integer path could be micro-optimized to bypass php_raw_url_encode() entirely, at least when the integer is not negative,
but for brewity, I didn't bother micro-optimizing it.1 parent 7e1d035 commit 54900d2
File tree
4 files changed
+57
-16
lines changed- ext/standard
- tests/strings
4 files changed
+57
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3715 | 3715 | | |
3716 | 3716 | | |
3717 | 3717 | | |
3718 | | - | |
| 3718 | + | |
3719 | 3719 | | |
3720 | 3720 | | |
3721 | 3721 | | |
| |||
3727 | 3727 | | |
3728 | 3728 | | |
3729 | 3729 | | |
3730 | | - | |
| 3730 | + | |
3731 | 3731 | | |
3732 | 3732 | | |
3733 | 3733 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
556 | 559 | | |
557 | | - | |
558 | | - | |
559 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
560 | 568 | | |
561 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
562 | 577 | | |
563 | 578 | | |
564 | 579 | | |
| |||
614 | 629 | | |
615 | 630 | | |
616 | 631 | | |
617 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
618 | 636 | | |
619 | | - | |
620 | | - | |
621 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
622 | 653 | | |
623 | | - | |
| 654 | + | |
624 | 655 | | |
625 | 656 | | |
626 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
0 commit comments