|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-12 09:19 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
Description: ------------ The (string) type casting statement does not convert to string Reproduce code: --------------- <?php $credit_card_number = 41058756689456878; $tempCCN = (string)$credit_card_number; $last_four_digits = substr($tempCCN,0,4); $cardLength = strlen($credit_card_number); function repeatChar($singleChar,$repeatTimes){ $returnThis = ""; $j = 0; while($j<$repeatTimes){ $returnThis .= $singleChar; $j++; } return($returnThis); } print(repeatChar("*",((int) $cardLength - 8)) . $last_four_digits); ?> Actual result: -------------- ************4.10