Skip to content

Commit 24d1814

Browse files
authored
Merge pull request #13 from nanasess/use-githubactions
PHP8.1 support
2 parents 4ebc867 + 6ef0418 commit 24d1814

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ ubuntu-latest ]
23-
php: [ '5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0' ]
23+
php: [ '5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
2424
dependencies: [ 'lowest', 'highest' ]
2525
steps:
2626
- uses: actions/checkout@v2

src/Util/Configuration.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -514,22 +514,17 @@ public function handlePHPConfiguration()
514514

515515
foreach (array('var', 'post', 'get', 'cookie', 'server', 'files', 'request') as $array) {
516516
// See https://github.com/sebastianbergmann/phpunit/issues/277
517-
switch ($array) {
518-
case 'var':
519-
$target = &$GLOBALS;
520-
break;
521-
522-
case 'server':
523-
$target = &$_SERVER;
524-
break;
525-
526-
default:
527-
$target = &$GLOBALS['_' . strtoupper($array)];
528-
break;
529-
}
530-
531517
foreach ($configuration[$array] as $name => $value) {
532-
$target[$name] = $value;
518+
switch ($array) {
519+
case 'var':
520+
$GLOBALS[$name] = $value;
521+
break;
522+
case 'server':
523+
$_SERVER[$name] = $value;
524+
break;
525+
default:
526+
$GLOBALS['_' . strtoupper($array)][$name] = $value;
527+
}
533528
}
534529
}
535530

src/Util/Getopt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected static function parseLongOption($arg, $long_options, &$opts, &$args)
144144

145145
if (substr($long_opt, -1) == '=') {
146146
if (substr($long_opt, -2) != '==') {
147-
if (!strlen($opt_arg)) {
147+
if (null === $opt_arg || strlen($opt_arg) < 1) {
148148
$opt_arg = current($args);
149149
next($args);
150150
if (!($opt_arg)) {

tests/Regression/GitHub/1337.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
GH-1337: Data Provider with \ at the end of the name breaks with process isolation
3+
--SKIPIF--
4+
<?php
5+
if (PHP_VERSION_ID >= 80100) die('Skipped: PHP 8.1 is deprecated'); ?>
6+
?>
37
--FILE--
48
<?php
59

0 commit comments

Comments
 (0)