Doc #40583 [Nab]: No explanation of "Illegal offset type"

From: Date: Mon, 21 May 2012 19:23:58 +0000
Subject: Doc #40583 [Nab]: No explanation of "Illegal offset type"
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8387@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=40583&edit=1 ID: 40583 User updated by: darrenoh at sidepotsinternational dot com Reported by: darrenoh at sidepotsinternational dot com Summary: No explanation of "Illegal offset type" Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: OS X PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Thank you. I would still like to see a section of the documentation devoted to error messages. Previous Comments: ------------------------------------------------------------------------ [2012-05-21 19:14:14] aholovsky at gmail dot com Your code should be: Reproduce code: --------------- foreach ($form['taxonomy'] as $key -> $vid) { if (substr($vid, 0, 1) != '#') { unset($form['taxonomy'][$key]); } } ------------------------------------------------------------------------ [2007-02-22 16:07:01] dmytton@php.net If you enter illegal offset type into the search box top right and select "online documentation" from the drop menu. The first result in the search is: Arrays - Manual A map is a type that maps values to keys. This type is optimized in several ways, so you can ... Doing so will result in a warning: Illegal offset type. ... php.net/manual/en/language.types.array.php - 21 Feb 2007 Even if you search google for the same query, the relevant PHP page is first ;) ------------------------------------------------------------------------ [2007-02-22 16:03:21] darrenoh at sidepotsinternational dot com There needs to be a way to search documentation for error messages like this. Maybe a PHP wiki? ------------------------------------------------------------------------ [2007-02-22 15:56:08] dmytton@php.net Yes, but it's documented in http://www.php.net/types.array which covers the use of an array as a key anywhere in any PHP code. It's not really specific to the unset() function. ------------------------------------------------------------------------ [2007-02-22 15:51:38] cynic@php.net the OP is complaining that it's not documented, not that it's happening. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=40583 -- Edit this bug report at https://bugs.php.net/bug.php?id=40583&edit=1

« previous php.doc.bugs (#8387) next »