php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81695 substring issue
Submitted: 2021-12-03 16:00 UTC Modified: 2021-12-03 16:29 UTC
From: felipeg at hemodynamics dot cl Assigned: cmb (profile)
Status: Not a bug Package: *Unicode Issues
PHP Version: 7.3.33 OS: linux, macos
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:
8 - 2 = ?
Subscribe to this entry?

 
 [2021-12-03 16:00 UTC] felipeg at hemodynamics dot cl
Description:
------------
---
From manual page: https://php.net/function.substr
---
I tested this problem on linux server, macOs and debian 9.9.
it looks like when substr evaluate "ñó", php translate as ?> and shows no output.

Test script:
---------------
echo substr("Diagnóstico: Infección del muñón, infracondilea izquierda\n", 0, 34);
echo substr("Diagnóstico: Infección del muñón, infracondilea izquierda\n", 0, 34);

Expected result:
----------------
Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?

Actual result:
--------------
Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-03 16:29 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-12-03 16:29 UTC] cmb@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

See <https://3v4l.org/FFte1> and <https://3v4l.org/Zv0oj>, and read
up on character encodings.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jun 27 15:05:44 2022 UTC