Public bug reported:

I observed a strange error when running PHPUnit tests with PHP 7.2 in Ubuntu 
18.04.1 LTS.
In various files, there is the error "Undefined variable: value", although the 
variable is actually defined.

Very weird: It is actually the variable name "$value" that PHP does not like.
When changing the variable name from "$value" e.g. to "$valueFoo", the error 
disappears in that file, but will appear again in another file where there is 
also a variable called "$value".

I tried both with the latest PHPUnit version 7.5.2, and with Ubuntu's
own package PHPUnit 6.5.5.

Using the latest PHP 7.2 from ppa:ondrej/php does not show this problem.

Is it possible that an outdated, buggy version of PHP 7.2 is used?
The build date is Sep 13 2018.

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by 
Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

Thanks for your help!
Martin

---------------------------------

These are some example errors that I get:

1) 
DH\CoreBundle\Tests\Service\DomainResolveServiceTest::testSubscriptionQueryIfNotInCache_enabled
Undefined variable: value

.../1_source/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:108
.../1_source/src/DH/CoreBundle/Service/CacheService.php:154 (NOTE: variable 
"$value" is used here)
.../1_source/src/DH/CoreBundle/Service/DomainResolveService.php:180
.../1_source/src/DH/CoreBundle/Service/DomainResolveService.php:127
.../1_source/src/DH/CoreBundle/Tests/Service/DomainResolveServiceTest.php:256


---------------------------------
There was 1 error:

1) DH\CoreBundle\Tests\Service\SystemSettingsServiceTest::testSet
DH\CoreBundle\Export\Exception\DatabaseException: Query failure

.../1_source/src/DH/CoreBundle/Service/SystemSettingsService.php:75
.../1_source/src/DH/CoreBundle/Tests/Service/SystemSettingsServiceTest.php:44

Caused by
PHPUnit\Framework\Error\Notice: Undefined variable: value

.../1_source/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:108
.../1_source/src/DH/CoreBundle/Service/SystemSettingsService.php:72 (NOTE: 
variable "$value" is used here)
.../1_source/src/DH/CoreBundle/Tests/Service/SystemSettingsServiceTest.php:44


---------------------------------
There were 7 errors:

1) DH\DataBundle\Tests\StorageModules\AmazonS3StorageTest::testReadFile
Undefined variable: value

.../1_source/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:108
.../1_source/vendor/guzzle/guzzle/src/Guzzle/Service/Description/Operation.php:105
 (NOTE: variable "$value" is used here)
.../1_source/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php:300
.../1_source/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php:68
.../1_source/src/DH/DataBundle/Tests/StorageModules/AmazonS3StorageTest.php:1461
.../1_source/src/DH/DataBundle/Tests/StorageModules/AmazonS3StorageTest.php:389


---------------------------------

$ lsb_release -rd
Description:    Ubuntu 18.04.1 LTS
Release:        18.04


$ sudo apt-cache policy pkgname php7.2
[sudo] password for faro: 
php7.2:
  Installed: 7.2.10-0ubuntu0.18.04.1
  Candidate: 7.2.10-0ubuntu0.18.04.1
  Version table:
 *** 7.2.10-0ubuntu0.18.04.1 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 
Packages
        100 /var/lib/dpkg/status
     7.2.3-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
N: Unable to locate package pkgname

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: php7.2 7.2.10-0ubuntu0.18.04.1
ProcVersionSignature: Ubuntu 4.15.0-45.48-generic 4.15.18
Uname: Linux 4.15.0-45-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
CurrentDesktop: XFCE
Date: Mon Feb  4 08:35:12 2019
PackageArchitecture: all
SourcePackage: php7.2
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: php7.2 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug bionic third-party-packages uec-images

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1814511

Title:
  Weird PHP error: "Undefined variable: value"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/php7.2/+bug/1814511/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to