Bug #71301 [NEW]: substr function behavior changed not documented

From: Date: Thu, 07 Jan 2016 10:35:45 +0000
Subject: Bug #71301 [NEW]: substr function behavior changed not documented
Groups: php.standards 
Request: Send a blank email to standards-+get-1007@lists.php.net to get a copy of this message
From:             jacky at xsteach dot com
Operating system: MacOSX 10.11.2
PHP version:      7.0.1
Package:          PHP Language Specification
Bug Type:         Bug
Bug description:substr function behavior changed not documented

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 bug report at https://bugs.php.net/bug.php?id=71301&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71301&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71301&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71301&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71301&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71301&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71301&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71301&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71301&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71301&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71301&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71301&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71301&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71301&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71301&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71301&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71301&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71301&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71301&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71301&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71301&r=mysqlcfg



Thread (2 messages)

« previous php.standards (#1007) next »