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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 10:01:32 2024 UTC