Bug #71301 [Csd->Nab]: substr function behavior changed not documented

From: Date: Thu, 07 Jan 2016 11:15:22 +0000
Subject: Bug #71301 [Csd->Nab]: substr function behavior changed not documented
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198485@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71301&edit=1

 ID:                 71301
 Updated by:         requinix@php.net
 Reported by:        jacky at xsteach dot com
 Summary:            substr function behavior changed not documented
-Status:             Closed
+Status:             Not a bug
 Type:               Bug
-Package:            PHP Language Specification
+Package:            Strings related
 Operating System:   MacOSX 10.11.2
 PHP Version:        7.0.1
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2016-01-07 10:40:42] jacky at xsteach dot com

my mistake.sorry!

------------------------------------------------------------------------
[2016-01-07 10:35:42] jacky at xsteach dot com

Description:
------------
The behavior of substr function have been changed on php 7, but not mention on the document.

Test script:
---------------
<?php

$s = substr('str',3);
var_dump($s);


// result on php 5.x
// bool(false)

// result on php 7
// string(0) ""

Expected result:
----------------
have the same result

Actual result:
--------------
the return type not compatible.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71301&edit=1


Thread (1 message)

  • requinix@php.net
  • Unknown Message
    • requinix@php.net
« previous php.bugs (#198485) next »