-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 7.3 #109
Comments
Anything else that might differ between the two versions? I've noticed that the Travis script did not include PHP 7.3, so I rectified that, but the tests run fine. |
@joshuabaker Can you please be a bit more specific about those two environments (extensions, settings)? |
@mundschenk-at It’s stock MAMP Pro on macOS without anything extra enabled. Specific PHP version is PHP 7.3.1. |
@joshuabaker There's something wrong with your PHP installation. $ php --version
PHP 7.3.5 (cli) (built: May 2 2019 12:40:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans
with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend Technologies
$ cat foo.php
<?php
require "vendor/autoload.php";
$settings = new \PHP_Typography\Settings();
$typography = new \PHP_Typography\PHP_Typography();
echo htmlentities($typography->process('Adipiscing Vehicula Ridiculus Pharetra', $settings));
echo "\n";
$ php foo.php
Adip­isc­ing Vehic­u­la Ridicu­lus Pharetra |
I’m getting the same output when using the same version in isolation, directly using MAMP’s PHP.
There’s clearly something going on that’s impacting the library elsewhere in the codebase. Do you have any pointers as to what that might be? |
It's pretty weird, looks like something is almost (but not quite) letter-spacing the output. Can you give me some idea what kind of codebase we are talking about? In a WordPress environment, I'd say something is filtering your output, but that's of course not the case here. Maybe some strange parameters for libxml? (Of course |
This is happening on a Craft CMS installation, which itself is based on Yii 2. @khalwat mentions that there’s others running into the same issue. |
@joshuabaker Any new findings? |
@mundschenk-at We‘ve put it down for now. Will report back here should we find anything. |
I am experiencing the same issue on my website |
Are you using Craft as well, @clarknelson? |
yes! I am using Craft 3.0.31, and the |
Well no, some kind of interaction with the Craft codebase it would seem. Unfortunately, I know nothing about Craft and cannot reproduce the issue standalone (as documented here). Bring me a minimal test case and I'll gladly fix any bug in PHP-Typography. |
@clarknelson If you read back, this library works fine in PHP 7.3. There’s something happening in the Craft environment that seems to be causing these issues. |
@joshuabaker Can you get me a list of installed packages in your Craft environment? It has to be a file that included directly by the autoloader (i.e. containing functions), otherwise this would not happen when you run the minimal example in your Craft directory. |
here are my composer dependencies, maybe there is a common package with @joshuabaker
|
@mundschenk-at Right. Got it. It’s not Craft per se. Problem SourceCraft is adjusting PHP’s string methods in the web bootstrap file. setlocale(
LC_CTYPE,
'C.UTF-8', // libc >= 2.13
'C.utf8', // different spelling
'en_US.UTF-8', // fallback to lowest common denominator
'en_US.utf8' // different spelling for fallback
); Test<?php
require_once 'vendor/autoload.php';
$settings = new \PHP_Typography\Settings();
$typography = new \PHP_Typography\PHP_Typography();
echo htmlentities($typography->process('Adipiscing Vehicula Ridiculus Pharetra', $settings)) . "\n";
// Adip­isc­ing Vehic­u­la Ridicu­lus Pharetra
// Craft’s normalization
setlocale(
LC_CTYPE,
'C.UTF-8', // libc >= 2.13
'C.utf8', // different spelling
'en_US.UTF-8', // fallback to lowest common denominator
'en_US.utf8' // different spelling for fallback
);
echo htmlentities($typography->process('Adipiscing Vehicula Ridiculus Pharetra', $settings)) . "\n";
// A&nbsp;d&nbsp;i&nbsp;p&nbsp;­&nbsp;i&nbsp;s&nbsp;c&nbsp;­&nbsp;i&nbsp;n&nbsp;g&nbsp;V&nbsp;e&nbsp;h&nbsp;i&nbsp;c&nbsp;­&nbsp;u&nbsp;­&nbsp;l&nbsp;a&nbsp;R&nbsp;i&nbsp;d&nbsp;i&nbsp;c&nbsp;u&nbsp;­&nbsp;l&nbsp;u&nbsp;s&nbsp;P&nbsp;h&nbsp;a&nbsp;r&nbsp;e&nbsp;t&nbsp;r&nbsp;a&nbsp; |
Should be resolved in craftcms/cms@8bf818a, which will be in the next release. |
I’m seeing some odd output from PHP 7.3.
Code
PHP 7.2 Output
PHP 7.3 Output
The text was updated successfully, but these errors were encountered: