|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-06-25 18:15 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 11 20:00:01 2025 UTC |
Description: ------------ The following code produces this result: a2345 This behaviour is not very useful, because this kind of error is extremly difficult to find. Reproduce code: --------------- <?php $in=array( 'params' => 'action=bla', 'action' => '', ); $params="12345"; // by error $params is a string // instead of array or empty $params['action']=@$in['params']; // and the following 2000 lines // of code is able to handle $params either // as array OR string (e. g. // cause of backward compatibility to // further versions of $in) print_r($params); ?> Expected result: ---------------- One (or more) of these * an array ( [0] => 12345 [action] => action=bla ) * if this result above, a warning message 'String is automagically converted to array, line 8' * an error message 'A string cannot indiced via string-type, use integer only, line 8' * a warning message 'Use of [] while indexing a string is depricated, use {}, line 8' * an error message 'Use of [] while indexing a string is not longer allowed, use {} instead, line 8' Actual result: -------------- a2345