note 25362 deleted from function.preg-match by nicos

From: Date: Fri, 20 Sep 2002 16:30:38 +0000
Subject: note 25362 deleted from function.preg-match by nicos
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37052@lists.php.net to get a copy of this message
The return type is listed as int, but all the examples show the return type being tested as boolean. Before thinking it through I wondered if it might return the number of pattern elements matched. My quick test returned the value 1 from an successful match on six pattern elements. Although you could construct a pattern where the the match succeeds with a variable number of subexpressions matched by marking entire subexpressions as optional, it doesn't make sense to think of it this way. Are there any other possible return codes aside from 0 or 1?

« previous php.notes (#37052) next »