|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-10-17 14:49 UTC] nikic@php.net
-Status: Open
+Status: Feedback
[2014-10-17 14:49 UTC] nikic@php.net
[2014-10-17 15:13 UTC] miloslav dot hula at gmail dot com
-Status: Feedback
+Status: Closed
[2014-10-17 15:13 UTC] miloslav dot hula at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 07:00:02 2025 UTC |
Description: ------------ Testing on af3354dc43ae3c4bc6c9a9fb74aee2d9c2f406e3 (10.10.2014). When calling finfo_buffer() from class method context, warning is emmited. It looks like the function is thinking that is finfo::buffer(). When I uncomment the first call in test below, I get SIGSEGV. Test script: --------------- // var_dump(finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), '<!DOCTYPE html>')); class Test { public function detect() { return finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), '<!DOCTYPE html>'); } } var_dump(finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), '<!DOCTYPE html>')); var_dump((new Test)->detect()); Expected result: ---------------- string(9) "text/html" string(9) "text/html" Actual result: -------------- string(9) "text/html" Warning: finfo_buffer() expects parameter 2 to be long, string given in /tmp/php7/finfo.php on line 7 bool(false)