MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001542XdebugRemote Debuggingpublic2018-03-27 16:442018-03-28 08:38
Reporterlinus 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version2.6.0 
Target VersionFixed in Version 
Summary0001542: variables created in a function body won't show up in PhpStorm
DescriptionWhen using Xdebug with PhpStorm and PHP 7.2 I cannot see the value of a variable set in a function. In contrast, if the variable is also a parameter to that function I can see it.

Sorry if this was mentioned somewhere, I couldn't find anything about this.


Steps To Reproducecreate PhpStorm project (empty) and add the following as index.php

'''
function hello($name){
    $x = 2;
    return "Hello" . $name;
}

echo hello("World");
'''

create a run configuration using php's built-in webserver

set breakpoint on $x = 2 line

open page in browser and step into

have a look at the variables info
Additional Information$ php7.2 -v
PHP 7.2.3-1+ubuntu17.10.1+deb.sury.org+1 (cli) (built: Mar 6 2018 11:19:27) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.3-1+ubuntu17.10.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

$ php7.1 -v
PHP 7.1.15-1+ubuntu17.10.1+deb.sury.org+2 (cli) (built: Mar 6 2018 11:10:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.15-1+ubuntu17.10.1+deb.sury.org+2, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

$ apt show php-xdebug
Package: php-xdebug
Version: 2.6.0+2.5.5-1+ubuntu17.10.1+deb.sury.org+1
TagsNo tags attached.
Operating SystemUbuntu 16.04
PHP Version7.2.0-7.2.4
Attached Files

- Relationships

-  Notes
(0004622)
linus (reporter)
2018-03-28 08:38

I might add that in addition to Ubuntu, this also doesn't work in Windows 7 (using XAMPP and PHP 7.2.3), but I am told by a colleague that it works just fine in PHP 7.2.0 (also XAMPP, but on Windows 10).

- Issue History
Date Modified Username Field Change
2018-03-27 16:44 linus New Issue
2018-03-28 08:38 linus Note Added: 0004622


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker