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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: felipeg at hemodynamics dot cl
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC