ID: 33938 User updated by: dan dot colascione at gmail dot com Reported By: dan dot colascione at gmail dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.0.4 New Comment:
It's not a bug in the sense that it does something wrong, but it is extremely unintuitive and and is a flaw in the PHP extension API. Shouldn't these things be fixed?! Previous Comments: ------------------------------------------------------------------------ [2005-08-01 00:43:14] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2005-07-31 22:11:20] dan dot colascione at gmail dot com Description: ------------ The INIT_OVERLOADED_CLASS_ENTRY macro assumes that it's being passed a static string array for its class_name parameter. It obtains the length of the string with sizeof(), when it should be using strlen. This leads to class names being silently truncated when classes are initialized with a string variable instead of a static string array. Reproduce code: --------------- char* a = get_some_string(); zend_class_entry ce; INIT_OVERLOADED_CLASS_ENTRY(ce, a, ...); Expected result: ---------------- The name of the class in ce should be the return value of get_some_string() Actual result: -------------- The name of the class is truncated to sizeof(char*)-1 characters. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33938&edit=1
