note 108106 added to language.types.array

From: Date: Thu, 29 Mar 2012 07:48:37 +0000
Subject: note 108106 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-186897@lists.php.net to get a copy of this message
Please note that adding the magic __toString() method to your objects will not allow you to seek an array with it, it still throws an Illegal Offset warning. The solution is to cast it to a string first, like this $array[(string) $stringableObject] ---- Server IP: 69.147.83.197 Probable Submitter: 87.213.99.206 ---- Manual Page -- http://www.php.net/manual/en/language.types.array.php Edit -- https://master.php.net/note/edit/108106 Del: integrated -- https://master.php.net/note/delete/108106/integrated Del: useless -- https://master.php.net/note/delete/108106/useless Del: bad code -- https://master.php.net/note/delete/108106/bad+code Del: spam -- https://master.php.net/note/delete/108106/spam Del: non-english -- https://master.php.net/note/delete/108106/non-english Del: in docs -- https://master.php.net/note/delete/108106/in+docs Del: other reasons-- https://master.php.net/note/delete/108106 Reject -- https://master.php.net/note/reject/108106 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186897) next »