note 87399 added to language.types.type-juggling

From: Date: Wed, 03 Dec 2008 19:18:59 +0000
Subject: note 87399 added to language.types.type-juggling
Groups: php.notes 
Request: Send a blank email to php-notes+get-147595@lists.php.net to get a copy of this message
json_decode users consider this, when casting stdClass to array: <?php $obj = new stdClass(); $obj->{"2"} = "id"; $arr = (array) $obj; $result = isset($arr["2"]) || array_key_exists(2, $arr); // false ?> ..though casting is at least 2x faster than foreach. ---- Server IP: 69.147.83.197 Probable Submitter: 87.110.228.219 ---- Manual Page -- http://www.php.net/manual/en/language.types.type-juggling.php Edit -- https://master.php.net/note/edit/87399 Del: integrated -- https://master.php.net/note/delete/87399/integrated Del: useless -- https://master.php.net/note/delete/87399/useless Del: bad code -- https://master.php.net/note/delete/87399/bad+code Del: spam -- https://master.php.net/note/delete/87399/spam Del: non-english -- https://master.php.net/note/delete/87399/non-english Del: in docs -- https://master.php.net/note/delete/87399/in+docs Del: other reasons-- https://master.php.net/note/delete/87399 Reject -- https://master.php.net/note/reject/87399 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#147595) next »