|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-07-07 09:18 UTC] body00 at gmail dot com
Description:
------------
When you try to typecast the values of an array such as
$myArray=array_map("(string)",$myArray)
transforms $myArray into NULL
Test script:
---------------
$myArray=array(123,246);
$myArray=array_map("(string)",$myArray);
Expected result:
----------------
$myArray=array("123","246");
Actual result:
--------------
NULL
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
The cast itself is not a function. Using strval you can accomplish what you are looking for. $myArray=array_map("strval",$myArray);