Doc #55742 [Opn->Csd]: Description of what happens if you pass a number
| From: | birke at d-scribe dot de | Date: | Tue, 20 Sep 2011 16:03:30 +0000 |
| Subject: | Doc #55742 [Opn->Csd]: Description of what happens if you pass a number | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7238@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55742&edit=1
ID: 55742
User updated by: birke at d-scribe dot de
Reported by: birke at d-scribe dot de
Summary: Description of what happens if you pass a number
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Not needed, the cytpe intro docs explain it.
Previous Comments:
------------------------------------------------------------------------
[2011-09-20 15:59:23] birke at d-scribe dot de
Description:
------------
---
From manual page: http://www.php.net/function.ctype-alnum
---
There should be the following warning in the docs:
If you are passing in a number, ctype_alnum will return false for all numbers that do not represent
alphanumeric character codes (see chr).
Test script:
---------------
<?php
$myVar = 10;
echo ctype_alnum($myVar) ? "T" : "F"; // returns F
$myVar = 48;
echo ctype_alnum($myVar) ? "T" : "F"; // returns T, because ASCII 48 =
"a"
$myVar = "10";
echo ctype_alnum($myVar) ? "T" : "F"; // returns T
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55742&edit=1