php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66123 Bu
Submitted: 2013-11-20 06:24 UTC Modified: 2013-11-20 22:49 UTC
From: bhupendra dot chouhan at webdunia dot net Assigned: aharvey (profile)
Status: Closed Package: Arrays related
PHP Version: 5.5.6 OS: any
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: bhupendra dot chouhan at webdunia dot net
New email:
PHP Version: OS:

 

 [2013-11-20 06:24 UTC] bhupendra dot chouhan at webdunia dot net
Description:
------------
Output is not same as given on site. ;-)

<?php 
$stack= array("12" => "green", "54" => "brown", "672" => "blue"); 
print_r($stack); 
$fruit = array_pop($stack); 
print_r($stack); 
?> 

Results of execution: 
Array 
( 
    [12] => green 
    [54] => brown 
    [672] => blue 
) 
Array 
( 
    [0] => green 
    [1] => brown 
) 


Test script:
---------------
Bug

Expected result:
----------------
Array 
( 
    [0] => green 
    [1] => brown 
) 

Actual result:
--------------
Array 
( 
    [12] => green 
    [54] => brown 
) 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-20 06:29 UTC] gabri dot ns at gmail dot com
which site? please provide the link!
 [2013-11-20 11:34 UTC] bl at panthera dot nl
This is in regards to a ten year old *comment* on the documentation for array_pop: http://www.php.net/manual/en/function.array-pop.php#36765
 [2013-11-20 22:49 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-11-20 22:49 UTC] aharvey@php.net
Comment removed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 04:00:01 2026 UTC