com php-src: Convert CRLF to LF: Zend/tests/array_unpack/basi c.phpt Zend/tests/array_unpack/classes.phpt Zend/test s/array_unpack/ref1.phpt

From: Date: Tue, 14 May 2019 00:59:06 +0000
Subject: com php-src: Convert CRLF to LF: Zend/tests/array_unpack/basi c.phpt Zend/tests/array_unpack/classes.phpt Zend/test s/array_unpack/ref1.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106171@lists.php.net to get a copy of this message
Commit: 63e43e19ea3f47cfbc28b02d0df3f0255d3d2309 Author: Peter Kokot <peterkokot@gmail.com> Tue, 14 May 2019 02:59:06 +0200 Parents: 9b18afcbca80e027859dab3b58f66dd901564be0 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=63e43e19ea3f47cfbc28b02d0df3f0255d3d2309 Log: Convert CRLF to LF Changed paths: M Zend/tests/array_unpack/basic.phpt M Zend/tests/array_unpack/classes.phpt M Zend/tests/array_unpack/ref1.phpt Diff: diff --git a/Zend/tests/array_unpack/basic.phpt b/Zend/tests/array_unpack/basic.phpt index 0e10638..3363c48 100644 --- a/Zend/tests/array_unpack/basic.phpt +++ b/Zend/tests/array_unpack/basic.phpt @@ -1,119 +1,119 @@ ---TEST-- -Basic array unpacking ---FILE-- -<?php -$array = [1, 2, 3]; - -function getArr() { - return [4, 5]; -} - -function arrGen() { - for($i = 11; $i < 15; $i++) { - yield $i; - } -} - -var_dump([...[]]); -var_dump([...[1, 2, 3]]); -var_dump([...$array]); -var_dump([...getArr()]); -var_dump([...arrGen()]); -var_dump([...new ArrayIterator(['a', 'b', 'c'])]); - -var_dump([0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()]); -var_dump([0, ...$array, ...$array, 'end']); - ---EXPECT-- -array(0) { -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(2) { - [0]=> - int(4) - [1]=> - int(5) -} -array(4) { - [0]=> - int(11) - [1]=> - int(12) - [2]=> - int(13) - [3]=> - int(14) -} -array(3) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" -} -array(15) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - [11]=> - int(11) - [12]=> - int(12) - [13]=> - int(13) - [14]=> - int(14) -} -array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(1) - [5]=> - int(2) - [6]=> - int(3) - [7]=> - string(3) "end" -} +--TEST-- +Basic array unpacking +--FILE-- +<?php +$array = [1, 2, 3]; + +function getArr() { + return [4, 5]; +} + +function arrGen() { + for($i = 11; $i < 15; $i++) { + yield $i; + } +} + +var_dump([...[]]); +var_dump([...[1, 2, 3]]); +var_dump([....$array]); +var_dump([...getArr()]); +var_dump([...arrGen()]); +var_dump([...new ArrayIterator(['a', 'b', 'c'])]); + +var_dump([0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()]); +var_dump([0, ...$array, ....$array, 'end']); + +--EXPECT-- +array(0) { +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(2) { + [0]=> + int(4) + [1]=> + int(5) +} +array(4) { + [0]=> + int(11) + [1]=> + int(12) + [2]=> + int(13) + [3]=> + int(14) +} +array(3) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + [2]=> + string(1) "c" +} +array(15) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(4) + [5]=> + int(5) + [6]=> + int(6) + [7]=> + int(7) + [8]=> + int(8) + [9]=> + int(9) + [10]=> + int(10) + [11]=> + int(11) + [12]=> + int(12) + [13]=> + int(13) + [14]=> + int(14) +} +array(8) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) + [5]=> + int(2) + [6]=> + int(3) + [7]=> + string(3) "end" +} diff --git a/Zend/tests/array_unpack/classes.phpt b/Zend/tests/array_unpack/classes..phpt index 349c5d9..573c5f1 100644 --- a/Zend/tests/array_unpack/classes.phpt +++ b/Zend/tests/array_unpack/classes.phpt @@ -1,46 +1,46 @@ ---TEST-- -Array unpacking with classes ---FILE-- -<?php - -class C { - public const FOO = [0, ...self::ARR, 4]; - public const ARR = [1, 2, 3]; - public static $bar = [...self::ARR]; -} - -class D { - public const A = [...self::B]; - public const B = [...self::A]; -} - -var_dump(C::FOO); -var_dump(C::$bar); - -try { - var_dump(D::A); -} catch (Error $ex) { - echo "Exception: " . $ex->getMessage() . "\n"; -} ---EXPECT-- -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -Exception: Cannot declare self-referencing constant 'self::B' \ No newline at end of file +--TEST-- +Array unpacking with classes +--FILE-- +<?php + +class C { + public const FOO = [0, ...self::ARR, 4]; + public const ARR = [1, 2, 3]; + public static $bar = [...self::ARR]; +} + +class D { + public const A = [...self::B]; + public const B = [...self::A]; +} + +var_dump(C::FOO); +var_dump(C::$bar); + +try { + var_dump(D::A); +} catch (Error $ex) { + echo "Exception: " . $ex->getMessage() . "\n"; +} +--EXPECT-- +array(5) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(4) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +Exception: Cannot declare self-referencing constant 'self::B' diff --git a/Zend/tests/array_unpack/ref1.phpt b/Zend/tests/array_unpack/ref1.phpt index 10b33b8..a43e2fa 100644 --- a/Zend/tests/array_unpack/ref1.phpt +++ b/Zend/tests/array_unpack/ref1.phpt @@ -1,17 +1,17 @@ ---TEST-- -Array unpacking with element rc=1 ---FILE-- -<?php - -$a = 1; -$b = [&$a]; //array (0 => (refcount=2, is_ref=1)=1) - -unset($a); //array (0 => (refcount=1, is_ref=1)=1) - -var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1) - ---EXPECT-- -array(1) { - [0]=> - int(1) -} +--TEST-- +Array unpacking with element rc=1 +--FILE-- +<?php + +$a = 1; +$b = [&$a]; //array (0 => (refcount=2, is_ref=1)=1) + +unset($a); //array (0 => (refcount=1, is_ref=1)=1) + +var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1) + +--EXPECT-- +array(1) { + [0]=> + int(1) +}

« previous php.cvs (#106171) next »