Bug #69172 [NEW]: array_slice behaviour BC in PHP7
From: hdtfonseca at gmail dot com
Operating system:
PHP version: master-Git-2015-03-03 (Git)
Package: Arrays related
Bug Type: Bug
Bug description:array_slice behaviour BC in PHP7
Description:
------------
The array_slice functions seems to being behaving differently in master
(PHP7).
The attached test script will output differently in PHP < 7
Test script:
---------------
$stack[] = 'wew';
$stack[] = 'wew';
$stack[] = 'wew';
$stack[] = 'wew';
$stack = array_slice($stack, 0, - 2);
$stack[] = 'wew';
print_r($stack);
Expected result:
----------------
Array
(
[0] => wew
[1] => wew
[2] => wew
)
Actual result:
--------------
Array
(
[0] => wew
[1] => wew
[3] => wew
)
--
Edit bug report at https://bugs.php.net/bug.php?id=69172&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69172&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69172&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69172&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69172&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69172&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69172&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69172&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69172&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69172&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69172&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69172&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69172&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69172&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69172&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69172&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69172&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69172&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69172&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69172&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69172&r=mysqlcfg
Thread (7 messages)
- hdtfonseca at gmail dot com