#44844 [Com]: array_pop brings error message if parameter is not an array

From: Date: Sun, 27 Apr 2008 02:04:43 +0000
Subject: #44844 [Com]: array_pop brings error message if parameter is not an array
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-753@lists.php.net to get a copy of this message
ID: 44844 Comment by: crrodriguez at suse dot de Reported By: Ultrasick at gmx dot de Status: Open Bug Type: Documentation problem Operating System: Linux PHP Version: 5.2.5 New Comment: This is a docu problem, fails to mention that the that the function emits a warning BTW.. it does return NULL, there is no problem with that. Previous Comments: ------------------------------------------------------------------------ [2008-04-26 19:49:35] Ultrasick at gmx dot de Description: ------------ <? array_pop($DoesntExist); ?> leads to: "Warning: array_pop() [function.array-pop]: The argument should be an array in /.../test.php on line 2" But documentation says: "If array is empty (or is not an array), NULL will be returned." Reproduce code: --------------- <? array_pop($DoesntExist); ?> Expected result: ---------------- should return NULL Actual result: -------------- "Warning: array_pop() [function.array-pop]: The argument should be an array in /.../test.php on line 2" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44844&edit=1

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