php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73927 phpdbg fails with windows error prompt at "watch array"
Submitted: 2017-01-13 14:28 UTC Modified: 2017-01-16 04:34 UTC
From: stahlstift at gmail dot com Assigned: bwoebi (profile)
Status: Assigned Package: phpdbg
PHP Version: 7.0.14 OS: Windows 10 Pro
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-01-13 14:28 UTC] stahlstift at gmail dot com
Description:
------------
C:\Users\username\PhpstormProjects\phpdbg>phpdbg
[Welcome to phpdbg, the interactive PHP debugger, v0.5.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
prompt> e test.php
[Set execution context: C:\Users\username\PhpstormProjects\phpdbg\test.php]
[Successful compilation of C:\Users\username\PhpstormProjects\phpdbg\test.php]
prompt> l 20
 00001: <?php
 00002:
 00003: // Generate some mock data
 00004: $example = [1, 23, 23423, 256436, 3463, 4363, 457];
 00005: foreach (range(1, 1000) as $val) {
 00006:     $example[] = mt_rand(1, 10000);
 00007: }
 00008:
 00009: // Stuff to debug
 00010: function doCoolStuff($value)
 00011: {
 00012:     $value++;
 00013:
 00014:     return mt_rand(1, 1000);
 00015: }
 00016:
 00017: $lower = [];
 00018: foreach ($example as $key => $value) {
 00019:     if ($value < 100) {
 00020:         $lower[] = $value;
prompt> b 19
[Breakpoint #0 added at C:\Users\username\PhpstormProjects\phpdbg\test.php:19]
prompt> r
[Breakpoint #0 at C:\Users\username\PhpstormProjects\phpdbg\test.php:19, hits: 1]
>00019:     if ($value < 100) {
 00020:         $lower[] = $value;
 00021:     } else {
prompt> c
[Breakpoint #0 at C:\Users\username\PhpstormProjects\phpdbg\test.php:19, hits: 2]
>00019:     if ($value < 100) {
 00020:         $lower[] = $value;
 00021:     } else {
prompt> w $value
[Set watchpoint on $value]
prompt> w $lower[]

Test script:
---------------
<?php

// Generate some mock data
$example = [1, 23, 23423, 256436, 3463, 4363, 457];
foreach (range(1, 1000) as $val) {
    $example[] = mt_rand(1, 10000);
}

// Stuff to debug
function doCoolStuff($value)
{
    $value++;

    return mt_rand(1, 1000);
}

$lower = [];
foreach ($example as $key => $value) {
    if ($value < 100) {
        $lower[] = $value;
    } else {
        doCoolStuff($value);
    }
}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-16 04:34 UTC] krakjoe@php.net
-Assigned To: +Assigned To: bwoebi
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC