note 116125 added to function.list

From: Date: Wed, 12 Nov 2014 02:24:26 +0000
Subject: note 116125 added to function.list
Groups: php.notes 
Request: Send a blank email to php-notes+get-200872@lists.php.net to get a copy of this message
The example states the following: <?php // list() doesn't work with strings list($bar) = "abcde"; var_dump($bar); // output: NULL ?> If the string is in a variable however, it seems using list() will treat the string as an array: <?php $string = "abcde"; list($foo) = $string; var_dump($foo); // output: string(1) "a" ?> This is because strings behave as arrays $name = "oscar"; Is like $name[0] = "o", $name[1] = "s", etc... ---- Server IP: 72.52.91.14 Probable Submitter: 189.197.160.230 ---- Manual Page -- http://php.net/manual/en/function.list.php Edit -- https://master.php.net/note/edit/116125 Del: integrated -- https://master.php.net/note/delete/116125/integrated Del: useless -- https://master.php.net/note/delete/116125/useless Del: bad code -- https://master.php.net/note/delete/116125/bad+code Del: spam -- https://master.php.net/note/delete/116125/spam Del: non-english -- https://master.php.net/note/delete/116125/non-english Del: in docs -- https://master.php.net/note/delete/116125/in+docs Del: other reasons-- https://master.php.net/note/delete/116125 Reject -- https://master.php.net/note/reject/116125 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200872) next »