3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for git.master_jit, git.master, rfc.property-hooks
wrapper("a",2) string(9) "wrapper: " array(2) { [0]=> string(1) "a" [1]=> int(2) } string(17) "wrapper slice-3: " array(0) { } wrapper("a",2,PDO::PARAM_INT) string(9) "wrapper: " array(3) { [0]=> string(1) "a" [1]=> int(2) [2]=> int(1) } string(17) "wrapper slice-3: " array(0) { } wrapper("a","foo",PDO::PARAM_INT) string(9) "wrapper: " array(3) { [0]=> string(1) "a" [1]=> string(3) "foo" [2]=> int(1) } string(17) "wrapper slice-3: " array(0) { } wrapper("a","foo",PDO::PARAM_INT,3) string(9) "wrapper: " array(4) { [0]=> string(1) "a" [1]=> string(3) "foo" [2]=> int(1) [3]=> int(3) } string(17) "wrapper slice-3: " array(1) { [0]=> int(3) } wrapper("a","foo",PDO::PARAM_INT,null) string(9) "wrapper: " array(4) { [0]=> string(1) "a" [1]=> string(3) "foo" [2]=> int(1) [3]=> NULL } string(17) "wrapper slice-3: " array(1) { [0]=> NULL } Deprecated: PDOStatement::bindParam(): Passing null to parameter #4 ($maxLength) of type int is deprecated in /in/biaIs on line 13

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
108.15 ms | 409 KiB | 5 Q