You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
php -v
PHP 7.0.10-1~dotdeb+8.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Better Function Replacer (BFR) v0.1, Copyright (C) 2015, by Lukas Rist
I'm using this code to test:
<?php
$ren=rename_function('strlen', 'old_strlen');
$ovr=override_function('strlen', '$string', 'return override_lenstr($string);');
function override_strlen($string) {
return 'THIS TEXT IS ADDED '.old_strlen($string);
}
echo "Results of rename and replace: |{$ren}|{$ovr}|\n";
$var='some string to be measured';
echo "The length of '{$var}' is (override) ".strlen($var)."\n";
echo "The length of '{$var}' is (rename) ".old_strlen($var)."\n";
This is the result:
Results of rename and replace: |1||
The length of 'some string to be measured' is (override) 26
The length of 'some string to be measured' is (rename) 26
As a side note, if I remove line 3 of above (the override_function line) strlen is still available.
Also, override_function never returns true.
Regards.
The text was updated successfully, but these errors were encountered:
I compiled the extension just fine on PHP7:
I'm using this code to test:
This is the result:
As a side note, if I remove line 3 of above (the
override_function
line)strlen
is still available.Also,
override_function
never returns true.Regards.
The text was updated successfully, but these errors were encountered: