php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38616 Substr function is misbehaving
Submitted: 2006-08-27 18:13 UTC Modified: 2006-08-27 18:25 UTC
From: tux at cenobioracing dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.4.4 OS: Linux
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: tux at cenobioracing dot com
New email:
PHP Version: OS:

 

 [2006-08-27 18:13 UTC] tux at cenobioracing dot com
Description:
------------
Substr function does not work correctly, see reproduce code:

Reproduce code:
---------------
<?php
echo substr('00001',-1,4);
?>

Expected result:
----------------
Print:
0001

Actual result:
--------------
Print:
1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-27 18:25 UTC] bjori@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Nov 28 11:00:02 2025 UTC