<?php
var_dump(sprintf('Er zijn %s nieuwe berichten', 5));
$callInfo = array_combine(['Er zijn %s nieuwe berichten'], [5]);
var_dump($callInfo);
var_dump(call_user_func_array('sprintf', $callInfo));
string(26) "Er zijn 5 nieuwe berichten"
array(1) {
["Er zijn %s nieuwe berichten"]=>
int(5)
}
Fatal error: Uncaught ArgumentCountError: sprintf() expects at least 1 argument, 0 given in /in/ApU7T:9
Stack trace:
#0 /in/ApU7T(9): sprintf(Er zijn %s nieuwe berichten: 5)
#1 {main}
thrown in /in/ApU7T on line 9
Process exited with code 255.