|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-02-21 19:05 UTC] darrenoh at sidepotsinternational dot com
Description:
------------
I'm having a problem with unset generating an "Illegal offset
type" error when I unset an array. My complaint is that
there's no way to find out what the error means or why the
unset command would generate it.
Reproduce code:
---------------
foreach ($form['taxonomy'] as $vid) {
if (substr($vid, 0, 1) != '#') {
unset($form['taxonomy'][$vid]);
}
}
Expected result:
----------------
I expected to be given an error message that I could find an
explanation for somewhere.
Actual result:
--------------
I found no explanation anywhere.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 17:00:02 2025 UTC |
Your code should be: Reproduce code: --------------- foreach ($form['taxonomy'] as $key -> $vid) { if (substr($vid, 0, 1) != '#') { unset($form['taxonomy'][$key]); } }