php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34134 list() constructor is broken with gettimeofday()
Submitted: 2005-08-15 12:57 UTC Modified: 2005-08-15 13:00 UTC
From: dr dot paul dot thomas at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2005-08-15 (snap) OS: Fedora Core 1
Private report: No CVE-ID: None
 [2005-08-15 12:57 UTC] dr dot paul dot thomas at gmail dot com
Description:
------------
When using list() to assign variable values returned by gettimeofday(), the assignments do not appear to occur.  Using print_r() shows that gettimeofday() appears to be returning array values fine.

Reproduce code:
---------------
An interactive session:


[paul@paul php5-STABLE-200508150842]$ ./sapi/cgi/php -qa
Interactive mode enabled

<?
print_r(gettimeofday());
Array
(
    [sec] => 1124102986
    [usec] => 124728
    [minuteswest] => -60
    [dsttime] => 0
)
list($a,$b,$c,$d)=gettimeofday();
echo "$a,$b,$c,$d\n";
,,,


Expected result:
----------------
echo "$a,$b,$c,$d\n";
1124102986,124728,-60,0

Actual result:
--------------
echo "$a,$b,$c,$d\n";
,,,


(see session above)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-15 13:00 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

list() only works with indexed arrays:
http://no.php.net/list
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 20 00:00:02 2025 UTC