|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69434 php_uname('m') reports wrong machine type
Submitted: 2015-04-13 07:17 UTC Modified: 2015-04-13 09:24 UTC
Avg. Score:1.8 ± 1.2
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: tm8544 at hotmail dot com Assigned:
Status: Open Package: *General Issues
PHP Version: 5.6.7 OS: Windows 7 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: tm8544 at hotmail dot com
New email:
PHP Version: OS:


 [2015-04-13 07:17 UTC] tm8544 at hotmail dot com
PHP_uname('m') gives wrong machine type.
In my case, processor is Intel Pentium 4, but PHP_uname('m')gives AMD64.

Test script:
echo php_uname('m');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-13 07:58 UTC] tm8544 at hotmail dot com
SYSTEM_INFO structure
PROCESSOR_ARCHITECTURE_AMD64 stands for x64 (AMD or Intel)

I suggest that instead of reporting "AMD64" PHP_uname('m') would report "x64".
 [2015-04-13 08:18 UTC]
I believe it should return x86_64 - like it does on Linux:

php -r 'echo php_uname("m");'
 [2015-04-13 08:34 UTC]
To change it would be a considerable BC break though, has been like that for a long time.

Not sure what is the best thing to do, it would be nice if they were consistent with each other, but I don't see a good way to actually do it.
 [2015-04-13 09:24 UTC]
IMHO this shouldn't be changed. AMD64 is historically a synonymous for any 64-bit architecture. This is a common terminology, on Windows it's a standard keyword, on some Linux distros  (fe Gentoo) as well.

 [2016-03-28 22:58 UTC] walts at jtechmedical dot com
I'm also seeing php_uname() reporting the wrong machine information

example output from php_uname()
Windows NT ELITE800 6.2 build 9200 (Windows 8 Professional Edition) i586

vs as reported from the substring in the user agent
Windows NT 10.0; WOW64

Machine is actually Windows NT 10.0; WOW64 so it seems something isn't reporting or parsing correctly in php_uname().
 [2016-03-28 23:00 UTC] walts at jtechmedical dot com
I should mention the PHP version is 5.5.30
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 23 16:01:23 2021 UTC