|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-08-12 21:38 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-08-12 21:38 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 07:00:01 2025 UTC |
Description: ------------ PHP 5.5.9-1ubuntu4.17 (cli) (built: May 19 2016 19:05:57) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies ==================================================================== This was also present in PHP 5.3.X versions When calling the substr function and passing it a length of 08 or 09 - it seems to return a null. Passing lengths of 8 or 9 return expected results. Test script: --------------- <?PHP $buffer = "This should work as expected."; echo substr($buffer , 0 , 1) ."\n"; echo substr($buffer , 0 , 01) ."\n"; echo substr($buffer , 0 , 7) ."\n"; echo substr($buffer , 0 , 07) ."\n"; echo substr($buffer , 0 , 8) ."\n"; echo substr($buffer , 0 , 08) ."\n"; //FAILS echo substr($buffer , 0 , 9) ."\n"; echo substr($buffer , 0 , 09) ."\n"; //FAILS echo substr($buffer , 0 , 10) ."\n"; echo substr($buffer , 0 , 10) ."\n"; ?>