Skip to content

create_function: deprecated 7.2 - Use anonymous functions instead. #35

Open

Description

@brainz80

When looking at the code I came across this hack in src/fpdm.php

//My PHP4/5 static call hack, only to make the callback $this->replace_value($matches,"$value") possible!
$callback_code='$THIS=new FPDM("[_STATIC_]");return $THIS->replace_value($matches,"'.$value.'");';

$field_regexp='/^\/(\w+)\s?(\<|\()([^\)\>]*)(\)|\>)/';

if(preg_match($field_regexp,$CurLine)) {
    //modify it according to the new value $value
    $CurLine = preg_replace_callback(
        $field_regexp,
        create_function('$matches',$callback_code),
        $CurLine
    );
}else {
    if($verbose_set) echo("<br>WARNING:".htmlentities("Can not access to the value: $CurLine using regexp $field_regexp"));
}

PHPs create_function() seems to be deprecated as of 7.2. So this hack might fail in the future.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions