php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78118 preg match error
Submitted: 2019-06-05 20:18 UTC Modified: 2019-07-03 08:58 UTC
From: v-altruo at microsoft dot com Assigned: cmb (profile)
Status: Assigned Package: Testing related
PHP Version: 7.3.6 OS: Windows
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
18 + 41 = ?
Subscribe to this entry?

 
 [2019-06-05 20:18 UTC] v-altruo at microsoft dot com
Description:
------------
Test fails for TS build only regardless of opcache on/off.

Test File location: tests\basic\bug71273.phpt 

Test script:
---------------
<?php
	/* NOTE this file is required to be encoded in iso-8859-1 */

	$cmd = getenv('TEST_PHP_EXECUTABLE') . " -n -d html_errors=on -d extension_dir=a/é/w -d extension=php_kartoffelbrei.dll -v 2>&1";
	$out = shell_exec($cmd);

	var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out));
?>

Expected result:
----------------
int(1)
==DONE==

Actual result:
--------------
int(0)
==DONE==

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-05 23:21 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-06-05 23:21 UTC] cmb@php.net
Thanks for reporting!  I cannot reproduce this test
failure,though.  Looking at the posted test script, there might be
an issue regarding the character encoding, since the extension_dir
is a/é/w (UTF-8), but the comment above states that the file is
required to be encoded in iso-8859-1.  Can you please
double-check, that the file's encoding is what it is supposed to
be?  Furthermore, for debugging purposes, it might be helpful to
insert a `var_dump($out);` after `$out = shell_exec($cmd);` to be
able to see in bug71273.out what was actually reported by PHP.
 [2019-06-06 00:13 UTC] v-altruo at microsoft dot com
-Status: Feedback +Status: Assigned
 [2019-06-06 00:13 UTC] v-altruo at microsoft dot com
I checked the file encoding with git bash and it says it's encoded in ISO-8859. Since this test passes on the NTS builds, I checked what the file was encoded for that and it is ISO-8859. So I believe the file being encoded as ISO-8859 is correct. 

The output after adding 'var_dump($out)' for TS builds: 
int(0)
NULL
==DONE==


Compared to NTS builds: 
int(1)
string(450) "PHP Warning:  PHP Startup: Unable to load dynamic library 'php_kartoffelbrei.dll' (tried: a/�/w\php_kartoffelbrei.dll (The specified module could not be found.), a/�/w\php_php_kartoffelbrei.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP 7.3.6 (cli) (built: May 29 2019 12:12:14) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
"
==DONE==
 [2019-06-11 16:26 UTC] cmb@php.net
Thanks for checking!

Unless being able to reproduce the test failure, I can only guess
that php_escape_html_entities() with ENT_HTML_SUBSTITUTE_ERRORS[1]
fails.  This needs further investigation.

[1] <https://github.com/php/php-src/blob/php-7.3.6/main/main.c#L949>
 [2019-07-03 05:00 UTC] noreply at exaple dot com
May be related to this bug. (PHP 7.2 -)

opcache On : zend_extension=php_opcache.dll

array (size=5)
  'Error' => boolean true
  0 => int 48
  1 => int 255
  2 => string '7.2.19' (length=6)
  3 => string 'apache2handler' (length=14)

opcache Off

array (size=5)
  'Error' => boolean false
  0 => int 48
  1 => int 48
  2 => string '7.2.19' (length=6)
  3 => string 'apache2handler' (length=14)

test php code
<?php
$s = '012345';
var_dump(['Error'=>ord('0')!==ord($s[0]), ord('0'), ord($s[0]),
          PHP_VERSION, PHP_SAPI]);
 [2019-07-03 08:58 UTC] cmb@php.net
> May be related to this bug. (PHP 7.2 -)

Unlikely, since this ticket is about an issue that happens
regardless of opcache on/off.

Please file a new tew ticket, and try to provide more information,
since I cannot reproduce: <https://3v4l.org/8SLkb>.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 25 20:01:27 2019 UTC