Skip to content

Xdebug breaks on access to class static property (php-dev:5.6) #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaluzki opened this issue Apr 13, 2018 · 5 comments
Closed

Xdebug breaks on access to class static property (php-dev:5.6) #224

kaluzki opened this issue Apr 13, 2018 · 5 comments

Comments

@kaluzki
Copy link
Contributor

kaluzki commented Apr 13, 2018

similar (same?) to docker-library/php#133

how to reproduce

<?php
/**
 * index.php
 *
 * webdevops/php-dev:5.6 => NOK
 * webdevops/php-dev:debian-8 => OK
 * webdevops/php-dev:centos-7-php56 => OK
 * webdevops/php-dev:alpine-php5 => OK
 */

/*
docker run --rm -v $(pwd):/app \
-e XDEBUG_REMOTE_HOST="172.19.0.1" \
-e XDEBUG_CONFIG="idekey=PHPSTORM" \
-e PHP_IDE_CONFIG="serverName=app" \
webdevops/php-dev:5.6 \
php /app/index.php
*/

class Foo {
    static $bar = 'bar';
    static function bar()
    {
        return self::$bar; // breakpoint
    }
}

echo Foo::bar();
PHP Fatal error:  Access to undeclared static property: Foo::$bar in /app/index.php on line 24
PHP Stack trace:
PHP   1. {main}() /app/index.php:0
PHP   2. Foo::bar() /app/index.php:28
@julesjcraske
Copy link

julesjcraske commented Apr 16, 2018

I have the same problem with the generic php/5.6-apache docker image when using xdebug, xdebug 2.5.5 installed via pecl

@PanadeEdu
Copy link
Member

PanadeEdu commented Jun 13, 2018

Tried to reproduce the issue.
For me It was working with given Images.
We just recently fixed the build mechanic so we have new images pushed to dockerhub.
This may have caused a fix on this issue.

Can someone please confirm that it is fixed?

My output, basicly using the given php file:
`Tried to reproduce the issue.
For me It was working with given Images.
We just recently fixed the build mechanic so we have new images pushed to dockerhub.
This may have caused a fix on this issue.

Can someone please confirm that it is fixed?

My output, basicly using the given php file:
image

@coding46
Copy link
Contributor

coding46 commented Jun 13, 2018

Works Fails for me too

bildschirmfoto 2018-06-13 um 22 16 49

bildschirmfoto 2018-06-13 um 22 17 02

@PanadeEdu
Copy link
Member

I was able to reproduce this issue myself.
I can confirm that it doesnt happen with other images.
I tried some things out and searched a bit and indeed this is a known bug, very specific to this image.

The best workaround seems to use another debugging tool or another image in this case.
If you use any of our other images, you should be good to go.
I put this on wont fix for now.

@boussou
Copy link

boussou commented Apr 22, 2020

see Use alternate Xdebug installation method on PHP 5.6

my127/docker-php@a9ae446

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants