<?php global $statement; $db = new PDO('sqlite:/tmp/tmp.db', 'test', 'test'); $statement = $db->prepare('select 1 where 1 = :a'); function wrapper(string $param, mixed $value, int $type = PDO::PARAM_STR, int $maxLength = null, mixed $driverOptions = null) { $statement = $GLOBALS['statement']; var_dump('wrapper: ', \func_get_args()); var_dump('wrapper slice-3: ', \array_slice(\func_get_args(), 3)); $statement->bindParam($param, $value, $type, ...\array_slice(\func_get_args(), 3)); } echo 'wrapper("a",2)', PHP_EOL; wrapper("a",2); echo 'wrapper("a",2,PDO::PARAM_INT)', PHP_EOL; wrapper("a",2,PDO::PARAM_INT); echo 'wrapper("a","foo",PDO::PARAM_INT)', PHP_EOL; wrapper("a","foo",PDO::PARAM_INT); echo 'wrapper("a","foo",PDO::PARAM_INT,3)', PHP_EOL; wrapper("a","foo",PDO::PARAM_INT,3); echo 'wrapper("a","foo",PDO::PARAM_INT,null)', PHP_EOL; wrapper("a","foo",PDO::PARAM_INT,null);
You have javascript disabled. You will not be able to edit any code.