Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.9.0

Bug #2771 Substr($var,4) not working for SAPI_ extensions
Submitted: 2004-11-16 19:27 UTC
From: fredericpoeydomenge Assigned: davey
Status: Closed Package: PHP_CompatInfo
PHP Version: 4.3.9 OS: Debian GNU/Linux
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 38 - 32 = ?

 [2004-11-16 19:27 UTC] fredericpoeydomenge
Description: ------------ When parsing a file containing functions declared in func_array.php with 'extension' = 'sapi_something', the substr($GLOBALS['funcs'][$name]['extension'],4) in CompatInfo.php returns the string "_something", but in this case it should be the string "something" ? Reproduce code: --------------- apache_request_headers(); apache_response_headers(); Expected result: ---------------- array(3) { string(6) "nsapi" string(4) "curl" string(5) "mysql" } Actual result: -------------- array(3) { string(6) "_nsapi" string(4) "curl" string(5) "mysql" }


 [2004-11-18 11:23 UTC] fredericpoeydomenge
You can find a patch taking into consideration the current bug, at the following adress : - Revamped func_array.php : one line per function, removed hashes 'extension' and 'version_init' (access via [0] and [1]), removed the prefix in extension names ('ext_' or 'sapi_') - Corrected CompatInfo.php to use [0] instead of ['extension'], and [1] instead of ['version_init'], and removed the 2 unneeded 'substr', bacause the extension name is already correct in func_array.php Regards
 [2005-01-11 05:20 UTC] davey
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at I have fixed this in PHP_CompatInfo 1.0.0RC3. I did not use the patch as other than the substr stuff it has no purpose. - Davey