You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Derk (JIRA)" <ji...@apache.org> on 2018/04/04 12:06:00 UTC
[jira] [Updated] (NETBEANS-587) Netbeans php debugger crash
anonymous function use by reference
[ https://issues.apache.org/jira/browse/NETBEANS-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Derk updated NETBEANS-587:
--------------------------
Summary: Netbeans php debugger crash anonymous function use by reference (was: Netbeans php debugger crash)
> Netbeans php debugger crash anonymous function use by reference
> ---------------------------------------------------------------
>
> Key: NETBEANS-587
> URL: https://issues.apache.org/jira/browse/NETBEANS-587
> Project: NetBeans
> Issue Type: Bug
> Environment: Linux Ubuntu 16.04LTS
> php --version: PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
> Netbeans 8.2
> Reporter: Derk
> Priority: Minor
> Attachments: bug.tgz
>
>
> How to reproduce:
> Take the files from the attachment and load the project in netbeans.
> Put a breakpoint on the last line (the "echo $var;" line)
> Click the "Debug Project" button in netbeans
> I run this script from the command line like so:
> {code:java}
> export XDEBUG_CONFIG="idekey=netbeans-xdebug"
> php -d xdebug.remote_enable=1 index.php
> {code}
> Press the green "play" button.
> Actual output "Socket Exception occured"
> Expected output: not to get this error but to have normal debugging output.
> Actual output in the console: Segmentation fault (core dumped)
> Expected output in the console: "1"
>
> Now look at line 3. Remove the & in front of $var to make the line look like this:
> {code:java}
> $anon_function = function() use ($var)
> {code}
> Try this how to reproduce again.
> Actual output: no error, everything works fine.
> Actual output in the console: "0"
> Note: The xdebug.log is included in the tarball, as requested from the error dialog from netbeans.
> If you can't get the attachment from this issue:
> Create a new netbeans php project (I choose "php project with existing sources").
> Have this php script as index.php:
> {code:java}
> <?php
> $var = 0;
> $anon_function = function() use (&$var)
> {
> $var++;
> };
> $anon_function();
> echo $var;
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists