ID:               16947
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         *General Issues
 Operating System: SunOS 5.8 Generic_108528-
 PHP Version:      4.1.2
 New Comment:

The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php




Previous Comments:
------------------------------------------------------------------------

[2002-05-01 15:34:17] [EMAIL PROTECTED]

checked the os with phpinfo()

------------------------------------------------------------------------

[2002-05-01 15:24:17] [EMAIL PROTECTED]

three test results...

----test case html----
<html>
<head>
<title>Filter Test</title>
</head>
<body bgcolor="#ffffff">
<?php
$input_to_test = "Here are some words. here is a naughty words. Some
final ending content.";
require("includes/old_filter.php");
$my_filter = new Filter("word_files/basicwords.txt");
$my_filter -> approve($input_to_test);
$v = $my_filter ->getViolatingContent();
echo "<H4>Violating</H4>";
for($i=0;$i<count($v);$i++){
  printf("%s<br>",$v[$i]);
}
echo "<h4>Keywords</h4>";
$keywords = $my_filter ->getKeywords($input_to_test);
for($i=0;$i<count($keywords);$i++){
  printf("%s<br>",$keywords[$i]);
}
?>
</body>
</html>


TEST #1
---- changing code as you suggested -----

    $this->violations = $violation_arr;
    $this->keywords = $keyword_arr;

produces the following output

Violating
Keywords
0 

TEST #2
---- my posted code-----

    $this->$violations = $violation_arr;
    $this->$keywords = $keyword_arr;

produces the following output

Violating
words.
naughty
words.
final
ending
content.

Keywords
0words.
naughty
words.
final
ending
content.

TEST #3
---- using my code but inverting the two assignment statements-----

    $this->$keywords = $keyword_arr;
    $this->$violations = $violation_arr;

produces the following output

Violating
naughty

Keywords
0naughty

again i remain pretty convinced this is some sort of bug...

------------------------------------------------------------------------

[2002-05-01 15:03:25] [EMAIL PROTECTED]

Looking at your code, your assigning $this->$violations which is very
different from $this->violations (NOTICE: the dollar sign AFTER the
arrow).

At the time of assignment, the $violations, is an empty var even. So
what would happen is that $this->=$arr_violations.

If that does anything usefull, it would probably be, something like:
foreach($violations as $key => $value)
{
   $this->$key=$value;
}

The object would then get property '0', '1','2' etc.

But that is more speculation than fact, because what you're trying to
do here is incorrect.

use:
$this->violations=$arr_violations;

then report back.

------------------------------------------------------------------------

[2002-05-01 14:34:19] [EMAIL PROTECTED]

i am trying to set the object variables $violations and $keywords to be
$violation_arr and $keyword_arr respectively. the assignment itself
works however it assigns the last value in this case $keyword_arr to
both. if i invert the order of the assignments doing the $violation
assignment last then both are set to that value. 

i do not believe the problem has anything to do with my use of this->
because again a value is being assigned but it is assigning to more
than one variable. 

of additonal note it does not set any of the other variables
$filter_name, $allowed_number and $filter_word_file.

------------------------------------------------------------------------

[2002-05-01 14:04:12] [EMAIL PROTECTED]

So what are you trying to do in those lines?

$this->$violations expands to $this->array(.....).
You want to make assign several properties all at once?
Or is:
$this->violations=$arr_violations;

the code you're looking for? And if so, does that fix the bug?

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/16947

-- 
Edit this bug report at http://bugs.php.net/?id=16947&edit=1

Reply via email to