php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73704 phpdbg shows the wrong line in files with shebang
Submitted: 2016-12-09 14:31 UTC Modified: 2017-01-02 09:22 UTC
From: stahlstift at gmail dot com Assigned: bwoebi (profile)
Status: Closed Package: phpdbg
PHP Version: 7.0.14 OS: Windows 10 Pro
Private report: No CVE-ID: None
 [2016-12-09 14:31 UTC] stahlstift at gmail dot com
Description:
------------
Win 10 Pro 64Bit - PHP 7.14 x84 NTS

C:\Users\username\PhpstormProjects\product\scripts>phpdbg -e orderimport.php env=development
[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>]
[Successful compilation of C:\Users\username\PhpstormProjects\product\scripts\orderimport.php]
prompt> l 10
 00001: <?php
 00002:
 00003: $application = require 'boot.php';
 00004:
 00005: require __DIR__ .'/../vendor/plugins/PluginName/scripts/orderimport/orderimporter.php';
prompt> b 2
[Breakpoint #0 added at C:\Users\username\PhpstormProjects\product\scripts\orderimport.php:2]
prompt> b 3
[Breakpoint #1 added at C:\Users\username\PhpstormProjects\product\scripts\orderimport.php:3]
prompt> b 4
[Breakpoint #2 added at C:\Users\username\PhpstormProjects\product\scripts\orderimport.php:4]
prompt> run
[Breakpoint #2 at C:\Users\username\PhpstormProjects\product\scripts\orderimport.php:4, hits: 1]
>00004:
 00005: require __DIR__ .'/../vendor/plugins/PluginName/scripts/orderimport/orderimporter.php';
prompt>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-21 01:57 UTC] bwoebi@php.net
-Status: Open +Status: Feedback
 [2016-12-21 01:57 UTC] bwoebi@php.net
Sorry for the delay.

I cannot reproduce this locally.

Could you please run: phpdbg -ep* orderimport.php
This should dump the opcodes, perhaps for some reasons you have opcodes on that line, it shouldn't even be possible to halt on line 4 here as there should be no opcodes...
 [2016-12-21 07:49 UTC] stahlstift at gmail dot com
-Status: Feedback +Status: Open
 [2016-12-21 07:49 UTC] stahlstift at gmail dot com
No problem - thanks for your afford!

Here the output:

C:\Users\username\PhpstormProjects\product\scripts>phpdbg -ep* orderimport.php
function name: (null)
L1-6 {main}() C:\Users\username\PhpstormProjects\product\scripts\orderimport.php - 0x6a76000 + 10 ops
 L4    #0     EXT_STMT
 L4    #1     EXT_FCALL_BEGIN
 L4    #2     INCLUDE_OR_EVAL         "boot.php"           @0
 L4    #3     EXT_FCALL_END
 L4    #4     ASSIGN                  $application         @0
 L6    #5     EXT_STMT
 L6    #6     EXT_FCALL_BEGIN
 L6    #7     INCLUDE_OR_EVAL         "C:\\Users\\username\"+
 L6    #8     EXT_FCALL_END
 L6    #9     RETURN                  1
[Script ended normally]
 [2016-12-21 11:17 UTC] bwoebi@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bwoebi
 [2016-12-21 11:17 UTC] bwoebi@php.net
Are you having by chance a shebang line in the script?

By including one, I could reproduce... will fix.
 [2016-12-21 11:18 UTC] bwoebi@php.net
-Summary: phpdbg stops in /shows the wrong line +Summary: phpdbg shows the wrong line in files with shebang
 [2016-12-21 23:39 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b2b080cbcdcadb97f9dd2db1a6e9e4200c34023
Log: Fixed bug #73704 (phpdbg shows the wrong line in files with shebang)
 [2016-12-21 23:39 UTC] bwoebi@php.net
-Status: Assigned +Status: Closed
 [2016-12-21 23:41 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b2b080cbcdcadb97f9dd2db1a6e9e4200c34023
Log: Fixed bug #73704 (phpdbg shows the wrong line in files with shebang)
 [2016-12-21 23:42 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b2b080cbcdcadb97f9dd2db1a6e9e4200c34023
Log: Fixed bug #73704 (phpdbg shows the wrong line in files with shebang)
 [2017-01-02 09:22 UTC] stahlstift at gmail dot com
Yes, there is a shebang in the first line. 

Thanks for fixing!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC