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
INIT_CLASS_ENTRY should use strlen() to determine class name length #10217
ghost changed the title [-]INIT_OVERLOADED_CLASS_ENTRY uses sizeof() to determine class name length[/-][+]INIT_CLASS_ENTRY uses sizeof() to determine class name length[/+]on Jan 4, 2023
I don't understand why this would be a bug. Are you writing a PHP extension? If so, you can use INIT_CLASS_ENTRY_EX() in the first place, if you are not passing a constant as class.
these are all required to compile on multiple versions of PHP (5.4->8.0)
Ugh, that's a tough requirement.
Anyhow, I think we can change INIT_OVERLOADED_CLASS_ENTRY and maybe some others to no longer use sizeof, but rather strlen() instead, but not everybody may like that (see #8336).
these are all required to compile on multiple versions of PHP (5.4->8.0)
Ugh, that's a tough requirement.
Anyhow, I think we can change INIT_OVERLOADED_CLASS_ENTRY and maybe some others to no longer use sizeof, but rather strlen() instead, but not everybody may like that (see #8336).
I think for stuff like this which may be used by extensions it makes sense to proceed with those changes compared to changing all possible instances within bundled extensions
changed the title [-]INIT_CLASS_ENTRY uses sizeof() to determine class name length[/-][+]INIT_CLASS_ENTRY should use strlen() to determine class name length[/+]on Jan 5, 2023
Activity
[-]INIT_OVERLOADED_CLASS_ENTRY uses sizeof() to determine class name length[/-][+]INIT_CLASS_ENTRY uses sizeof() to determine class name length[/+]cmb69 commentedon Jan 4, 2023
I don't understand why this would be a bug. Are you writing a PHP extension? If so, you can use
INIT_CLASS_ENTRY_EX()in the first place, if you are not passing a constant asclass.cmb69 commentedon Jan 4, 2023
Ugh, that's a tough requirement.
Anyhow, I think we can change
INIT_OVERLOADED_CLASS_ENTRYand maybe some others to no longer usesizeof, but ratherstrlen()instead, but not everybody may like that (see #8336).Girgias commentedon Jan 4, 2023
I think for stuff like this which may be used by extensions it makes sense to proceed with those changes compared to changing all possible instances within bundled extensions
cmb69 commentedon Jan 5, 2023
@dbuteyn, maybe you want to provide a respective PR?
cmb69 commentedon Jan 5, 2023
Yeah, I don't think
sizeofhas been used for any other purpose than having the optimization (old compilers may not have optimizedstrlen()).[-]INIT_CLASS_ENTRY uses sizeof() to determine class name length[/-][+]INIT_CLASS_ENTRY should use strlen() to determine class name length[/+]Close phpGH-10217: Use strlen() for determining the class_name length