note 116484 added to function.array-column

From: Date: Sat, 10 Jan 2015 02:31:22 +0000
Subject: note 116484 added to function.array-column
Groups: php.notes 
Request: Send a blank email to php-notes+get-201397@lists.php.net to get a copy of this message
Please note this function accepts 2D-arrays ONLY, and silently returns empty array when non-array argument is provided. Code: class testObject { public $a = 123; } $testArray = [new testObject(), new testObject(), new testObject()]; $result = array_column($testArray, 'a')); //array(0) { } ---- Server IP: 72.52.91.14 Probable Submitter: 85.202.110.195 ---- Manual Page -- http://php.net/manual/en/function.array-column.php Edit -- https://master.php.net/note/edit/116484 Del: integrated -- https://master.php.net/note/delete/116484/integrated Del: useless -- https://master.php.net/note/delete/116484/useless Del: bad code -- https://master.php.net/note/delete/116484/bad+code Del: spam -- https://master.php.net/note/delete/116484/spam Del: non-english -- https://master.php.net/note/delete/116484/non-english Del: in docs -- https://master.php.net/note/delete/116484/in+docs Del: other reasons-- https://master.php.net/note/delete/116484 Reject -- https://master.php.net/note/reject/116484 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201397) next »