php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11342 array_shift & array_pop element whith value 0 don't work
Submitted: 2001-06-07 20:59 UTC Modified: 2001-06-08 14:29 UTC
From: jd at linuxrea dot net Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.0.4pl1 OS: mandrake 8.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jd at linuxrea dot net
New email:
PHP Version: OS:

 

 [2001-06-07 20:59 UTC] jd at linuxrea dot net
if i do $minutes=array(0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55);

and after i do :
while($vname = array_shift($minutes))
{
	print "$vname<br>\n";
}
i have nothing in output

and if i do after:

while($vname = array_pop($minutes))
{
	print "$vname<br>\n";
}

I've all values except the '0'.

Julien dumont
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-08 14:29 UTC] sniper@php.net
Not a bug. In PHP 0 is treated as NULL.
You have to check it with !== or === which checks the type.

if($vname!==NULL)

--Jani

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 13:01:33 2025 UTC