php - The type of the third parameter in preg_match_all() when no matches are found -


i'm using preg_match_all() in project find matches in given string. example:

preg_match_all( $pattern, $subject, $matches, $flags ); 

if matches found, $matches parameter multidimensional array of matches ordered according $flags.

if matches weren't found, type $matches be? still array, albeit empty array, or else such false or null?

ref: http://php.net/manual/en/function.preg-match-all.php

$matches array containing empty sub-array. it's can test yourself.

<?php  preg_match_all('/o/', 'foo', $matches); var_dump($matches); 

output:

array(1) {   [0]=>   array(0) {   } } 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -