php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78386 fstat mode has unexpected value on PHP 7.4
Submitted: 2019-08-08 20:01 UTC Modified: 2019-08-09 08:19 UTC
From: theodorejb at outlook dot com Assigned: cmb (profile)
Status: Closed Package: Filesystem function related
PHP Version: 7.4.0beta2 OS: Windows 10
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:
47 + 29 = ?
Subscribe to this entry?

 
 [2019-08-08 20:01 UTC] theodorejb at outlook dot com
Description:
------------
PHP 7.4 beta 2 returns a different fstat mode value for file pointers than PHP 7.3. This is causing functionality in Slim-Psr7 to break.

Test script:
---------------
<?php

$handle = popen('echo 12', 'r');
$stats = fstat($handle);
var_dump($stats['mode']); // PHP 7.3 prints 4096, PHP 7.4 beta 2 prints 33206

$isPipe = ($stats['mode'] & 0010000) !== 0;
var_dump($isPipe); // PHP 7.3 prints true, PHP 7.4 beta 2 prints false



Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-09 08:19 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2019-08-09 08:19 UTC] cmb@php.net
Thanks for reporting!
 [2019-08-09 09:16 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #78386: fstat mode has unexpected value on PHP 7.4
On GitHub:  https://github.com/php/php-src/pull/4498
Patch:      https://github.com/php/php-src/pull/4498.patch
 [2019-08-20 14:05 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c03114e55c7b9367fc9be895fe0df01cd1b62cab
Log: Fix #78386: fstat mode has unexpected value on PHP 7.4
 [2019-08-20 14:05 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 03:01:29 2024 UTC