Commit 3f8ef07
Sjoerd Langkemper
Throw error for invalid characters for number base
This is about the situation where a character is not within the
specified number base. E.g. only 0-9, a-f are allowed for hexadecimal,
so what should `hexdec('z')` do?
In the past, such characters were silently ignored. Since PHP 7.4 a
deprecation notice would be generated. This commit changes that to a
ValueError.
Earlier RFC:
https://wiki.php.net/rfc/base_convert_improvements1 parent e71b4e5 commit 3f8ef07
17 files changed
Lines changed: 323 additions & 596 deletions
File tree
- ext/standard
- tests/math
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
| 848 | + | |
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
| 911 | + | |
| 912 | + | |
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
915 | 916 | | |
916 | 917 | | |
917 | 918 | | |
918 | 919 | | |
| 920 | + | |
919 | 921 | | |
920 | 922 | | |
921 | 923 | | |
| |||
1033 | 1035 | | |
1034 | 1036 | | |
1035 | 1037 | | |
1036 | | - | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1037 | 1041 | | |
1038 | 1042 | | |
1039 | 1043 | | |
| |||
1046 | 1050 | | |
1047 | 1051 | | |
1048 | 1052 | | |
1049 | | - | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1050 | 1056 | | |
1051 | 1057 | | |
1052 | 1058 | | |
| |||
1059 | 1065 | | |
1060 | 1066 | | |
1061 | 1067 | | |
1062 | | - | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1063 | 1071 | | |
1064 | 1072 | | |
1065 | 1073 | | |
| |||
1136 | 1144 | | |
1137 | 1145 | | |
1138 | 1146 | | |
1139 | | - | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1140 | 1151 | | |
1141 | 1152 | | |
1142 | 1153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments