You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
parse_ini_file parse_ini_string bug when when INI_SCANNER_TYPED #11010
The INI scanner converts each token (word) independently. If it is convertible (analogous to is_numeric in PHP) it will be, no matter where after = it appears. https://3v4l.org/0BjuD We might want to try converting the values only in the parser when they appear as standalone values (i.e. when they aren't part of some other expression). I'll give that a shot.
This was indeed intentional because the changes were non-trivial and affect all of ini parsing. Sorry @GajowyJ, my communication was clearly inadequate here.
Activity
iluuu1994 commentedon Apr 4, 2023
The INI scanner converts each token (word) independently. If it is convertible (analogous to
is_numericin PHP) it will be, no matter where after=it appears. https://3v4l.org/0BjuD We might want to try converting the values only in the parser when they appear as standalone values (i.e. when they aren't part of some other expression). I'll give that a shot.GajowyJ commentedon Apr 21, 2023
@iluuu1994
Nothing has changed in PHP v 8.1.18. The issue still exists. Shouldn't the ticket be reopened?
damianwadley commentedon Apr 21, 2023
@GajowyJ The fix has only been added to master, which means as things are now it will only be present in the next series of PHP (probably 8.3).
@iluuu1994 Is that intentional?
iluuu1994 commentedon Apr 21, 2023
This was indeed intentional because the changes were non-trivial and affect all of ini parsing. Sorry @GajowyJ, my communication was clearly inadequate here.
iluuu1994 commentedon Apr 21, 2023
@GajowyJ The way you can avoid this at the moment is to wrap the value in double quotes (
""). https://3v4l.org/QSBA3GajowyJ commentedon Apr 21, 2023
@iluuu1994 @damianwadley
Thank you for the clarification.
Improve ini number handling with INI_SCANNER_TYPED