explodetakes a specification string as the second argument . You gave it null, so before starting the logic explodePHP converts nullto a string. Each function works as follows: if the arguments do not correspond to the formal specification, PHP tries to “type juggling” until this happens. If PHP can juggle, the engine moves together happily, otherwise you will get a faint slap on the wrist:
PHP Warning: explode() , 2 , .php 1
PHP : null := ''. , null '' - , :
$a = explode(',', '');
$b = explode(',', null);
var_dump($a === $b);
$a = count(explode(',', ''));
$b = count(explode(',', null));
var_dump($a === $b);
, : PHP ? :
, ... , .