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

From: Date: Thu, 07 Jan 2016 10:40:44 +0000
Subject: Bug #71301 [Opn->Csd]: substr function behavior changed not documented
References: 1  Groups: php.standards 
Request: Send a blank email to standards-+get-1008@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
 User updated by:    jacky at xsteach dot com
 Reported by:        jacky at xsteach dot com
 Summary:            substr function behavior changed not documented
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            PHP Language Specification
 Operating System:   MacOSX 10.11.2
 PHP Version:        7.0.1
 Block user comment: N
 Private report:     N

 New Comment:

my mistake.sorry!


Previous Comments:
------------------------------------------------------------------------
[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 (2 messages)

« previous php.standards (#1008) next »