php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79472 ext/ffi/tests/040.phpt TC fails on Big endian arch
Submitted: 2020-04-13 11:42 UTC Modified: 2020-04-14 18:06 UTC
From: vibhutisawant18 at gmail dot com Assigned: dmitry (profile)
Status: Closed Package: Testing related
PHP Version: master-Git-2020-04-13 (Git) OS: Ubuntu 16.04
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vibhutisawant18 at gmail dot com
New email:
PHP Version: OS:

 

 [2020-04-13 11:42 UTC] vibhutisawant18 at gmail dot com
Description:
------------
ext/ffi/tests/040.phpt TC fails as the actual output obtained on big endian doesnt match the expected output which is specific to little endian arch.

FFI\CType data stores an int value as int32_t datatype comprising of 4 bytes, when the same variable is type casted to int8_t[4](an array of int8_t), the value returned on little endian is

FFI\CData:int8_t[4] Object
(
[0] => 5
[1] => 0
[2] => 0
[3] => 0
)

whereas the output obtained on big endian is :
FFI\CData:int8_t[4] Object
(
[0] => 0
[1] => 0
[2] => 0
[3] => 5
)


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-04-13 18:05 UTC] girgias@php.net
-Assigned To: +Assigned To: dmitry
 [2020-04-13 18:05 UTC] girgias@php.net
Assigning to dmitry as he's the maintainer of FFI
 [2020-04-13 21:25 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #79472: ext/ffi/tests/040.phpt TC fails on Big endian arch
On GitHub:  https://github.com/php/php-src/pull/5383
Patch:      https://github.com/php/php-src/pull/5383.patch
 [2020-04-14 18:06 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 00:01:25 2020 UTC