Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brainz80 opened this issue Aug 7, 2020 · 0 comments
Open

Comments

@brainz80
Copy link

brainz80 commented Aug 7, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant