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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 4 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC