Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101632 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24692 invoked from network); 19 Jan 2018 22:07:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2018 22:07:28 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.216.174 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.216.174 mail-qt0-f174.google.com Received: from [209.85.216.174] ([209.85.216.174:36379] helo=mail-qt0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/FF-12394-02C626A5 for ; Fri, 19 Jan 2018 17:07:28 -0500 Received: by mail-qt0-f174.google.com with SMTP id z11so7467009qtm.3 for ; Fri, 19 Jan 2018 14:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ylv0u+kxif+uT0IMFJUEYs7SEBECLKRMJ45CI1er/uc=; b=IUu2CDaxgauF0xQnBGnWiaEzhqToYRxNf/0iBJogDGsWMNsRhKooAJY/q1uHK3JgqU o0agJAbn/qRcSua0Ubgz2A3OBfMA6e0C0CPV7iKEWTP0fkDJife4UHDcOSfonPTDrxVL hzHBWPaTELXZS1w3pHP6EAuhLrr89du1Kt+9GnRSlJJ47/rxSOpcQA3OGIXuvO5uZAlS rQUTyq4PnHP5IJFOxksFdjsWfp4EdBY8kNHToXR4AW3kUUtHei3bdGAvvr+s7IUE+bdz 6bQnqarKNuI4I6KSFMShA5yQ574h78imTK0O0ZNk1MeGTlcVhzxUAfLKpJRaiK0+kBOs KnLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ylv0u+kxif+uT0IMFJUEYs7SEBECLKRMJ45CI1er/uc=; b=F3FuxjSpFeq+wxKgLqh32SGwfAa5zolaJEugwJcef+ULMbtoXvNGwXKSt8tA+1wqeC u87s1ssQphUX3lIE6ATG/w2/14FXyOlveR1eM6JZg4xWEdjZnotEKc3EI6zy1CtbhotB uw60GIt8udz0vLcjwEqPVQqUGiXi7KBnQcKIvdA5cWrA26fNxkZAiobTZ5uHDCpGWJkF BPBB9SSUCJaObhRdV72BQs3kfx5rf9EjFAOJ5mDSBf4UUm23+1tk9E4RXbYiXK3JF4kE OjuNdadYT2Y+P2/lKte/R22kWWbYkDR+PF9jTfA0+cndjdHeOhnDOz4mUhivMHsWEmKx yLKA== X-Gm-Message-State: AKwxytfQcCTngOYum2NwhpQzuCAf7fLuo4+mTVmLSBg0z3EZILJYXQbN feO3P4bQ8g7U8IhhGdBVuL9bR1xCZ5lmZGABizHFNXW1 X-Google-Smtp-Source: AH8x225fWtiX8g0dekAHlz6CE2eY+5QtaledoMQccyjDyuWaYcstI0x9cAR6hir1suCYtlQy0i3RFtzaEXt1DO92f2g= X-Received: by 10.55.124.70 with SMTP id x67mr1798342qkc.114.1516399645841; Fri, 19 Jan 2018 14:07:25 -0800 (PST) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.12.197.144 with HTTP; Fri, 19 Jan 2018 14:07:25 -0800 (PST) X-Originating-IP: [206.252.215.26] In-Reply-To: References: Date: Fri, 19 Jan 2018 17:07:25 -0500 X-Google-Sender-Auth: vunhEOZruwwCYpse4qqWmBML2Fg Message-ID: To: Sam Ding Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Big_Endian problem From: pollita@php.net (Sara Golemon) On Fri, Jan 19, 2018 at 4:04 PM, Sam Ding wrote: > The test case ext/standard/tests/general_functions/bug72300.phpt is failed > on s390x. > The function "ignore_user_abort" returns "256" on s390x, and "1" on x86_64 > after "ignore_user_abort" is set to true; > The root reason is because of Big_Endian on s390x. > Here is the C code: ext/standard/basic_functions.c > b/ext/standard/basic_functions.c:5641 > > old_setting = (unsigned short)PG(ignore_user_abort); > // php_core_globals.ignore_user_abort, "x /2b" shows its > value : "0x01 0x00" on both platforms > That specific line isn't the problem, as it's just cashing a short to an unsigned short, which is legal and not problematic for any endianness. The actual problem is that PG(ignore_user_abort) is declared as a short, but its INI handler method is defined as OnUpdateBool (which of course, only operates on a single byte). > Does PHP interpreter support Big_Endian? Are there any existing > macros/functions to deal with Big/Little Endian? > Yep. And if things break on s390x, please let us know! I'll put together a fix for this over the weekend and apply it to 7.0 and later versions. -Sara