svn: /phpdoc/en/trunk/reference/filter/ examples.xml
| From: | Peter Cowburn | Date: | Fri, 25 Sep 2009 11:10:55 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/filter/ examples.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4982@lists.php.net to get a copy of this message | ||
salathe Fri, 25 Sep 2009 11:10:55 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=288748
Log:
Strict comparison of filter_var return values in examples. Fixes #49665
Bug: http://bugs.php.net/49665 (Open) bad example for
filter_var() in documentation
Changed paths:
U phpdoc/en/trunk/reference/filter/examples.xml
Modified: phpdoc/en/trunk/reference/filter/examples.xml
===================================================================
--- phpdoc/en/trunk/reference/filter/examples.xml 2009-09-25 10:56:17 UTC (rev 288747)
+++ phpdoc/en/trunk/reference/filter/examples.xml 2009-09-25 11:10:55 UTC (rev 288748)
@@ -75,18 +75,18 @@
'max_range' => 3,
)
);
-if (filter_var($int_a, FILTER_VALIDATE_INT, $options)) {
+if (filter_var($int_a, FILTER_VALIDATE_INT, $options) !== FALSE) {
echo "This (int_a) integer is considered valid (between 0 and 3).\n";
}
-if (filter_var($int_b, FILTER_VALIDATE_INT, $options)) {
+if (filter_var($int_b, FILTER_VALIDATE_INT, $options) !== FALSE) {
echo "This (int_b) integer is considered valid (between 0 and 3).\n";
}
-if (filter_var($int_c, FILTER_VALIDATE_INT, $options)) {
+if (filter_var($int_c, FILTER_VALIDATE_INT, $options) !== FALSE) {
echo "This (int_c) integer is considered valid (between 0 and 3).\n";
}
$options['options']['default'] = 1;
-if ($int_c = filter_var($int_c, FILTER_VALIDATE_INT, $options)) {
+if (($int_c = filter_var($int_c, FILTER_VALIDATE_INT, $options)) !== FALSE) {
echo "This (int_c) integer is considered valid (between 0 and 3) and is $int_c.";
}
?>