PFBC script not working after migrating from PHP5 to PHP7 (Array to string conversion)

Viewed 8

I had a very old script originally written in PHP5 that was using the PFBC library (https://code.google.com/archive/p/php-form-builder-class/). The machine was working untocuhed since 2014, but the time has came to replace it. However, the script is not working on modern PHP anymore. There is basically one part of the code that makes problems:

foreach($properties as $property => $value) {
  $property = strtolower($property);
     if($property[0] != "_") {
         if(isset($method_reference["set" . $property]))
                  $this->$method_reference["set" . $property]($value);
         elseif(isset($property_reference[$property]))
                  $this->$property_reference[$property] = $value;
         else
                  $this->setAttribute($property, $value);
         }
    }

and it gives a lot of notices about "Array to string conversion" and finally a fatal error "Function name must be a string". I wonder what would be the easiest way to get around this.

0 Answers
Related