#23390 [Opn->Bgs]: similar_text() requires reference but generates warning
ID: 23390
Updated by: moriyoshi@php.net
Reported By: phpbugs at localpin dot com
-Status: Open
+Status: Bogus
Bug Type: PHP options/info functions
Operating System: Windows XP Home Edition
PHP Version: 4.3.1
New Comment:
<?php
similar_text('foo', 'fubar', $sim);
echo $sim;
?>
will do; No "&" is needed in the third parameter.
Previous Comments:
------------------------------------------------------------------------
[2003-04-28 17:02:14] phpbugs at localpin dot com
(I think this is supposed to be fixed 'in CVS' whatever that means, but
just in case...)
similar_text() requires a parameter by reference but generates a
warning for doing so! My log file is thus packed with warnings as
follows, and I must switch off the php.ini setting which warns about
such things.
[Mon Apr 28 23:37:25 2003] [error] PHP Warning: Call-time
pass-by-reference has been deprecated - argument passed by value; If
you would like to pass it by reference, modify the declaration of
similar_text(). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true
in your INI file. However, future versions may not support this any
longer.
I am told to "modify the declaration of similar_text()", a PHP
function!
I would suggest that if PHP is deprecating pass-by-reference:
- this function be changed ASAP
- this function (and any others) that are part of PHP and use reference
variables do not issue a warning
- at the very least, a note in the documentation for similar_text()
about this.
It is my aim (and the general aim of good programming I suppose) to log
and fix ALL errors, but this one makes this aim impossible unless I
switch this error off completely!
Thanks!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23390&edit=1
Thread (2 messages)