Doc #78218 [Asn->Opn]: function intercepts execution of code that is not executed

From: Date: Wed, 26 Jun 2019 16:09:18 +0000
Subject: Doc #78218 [Asn->Opn]: function intercepts execution of code that is not executed
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16784@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78218&edit=1

 ID:                 78218
 Updated by:         cmb@php.net
 Reported by:        lozinskiy dot artem at gmail dot com
 Summary:            function intercepts execution of code that is not
                     executed
-Status:             Assigned
+Status:             Open
 Type:               Documentation Problem
 Package:            Unknown/Other Function
 Operating System:   Ubuntu 18.04 LTS
-PHP Version:        7.1.30
+PHP Version:        7.2.19
-Assigned To:        cmb
+Assigned To:        
 Block user comment: N
 Private report:     N

 New Comment:

Thanks!


Previous Comments:
------------------------------------------------------------------------
[2019-06-26 16:03:11] lozinskiy dot artem at gmail dot com

>> Does this issue also happen with any actively
supported PHP version?
Yes, on versions 7.2-7.3, this problem persists.

------------------------------------------------------------------------
[2019-06-26 15:45:04] cmb@php.net

PHP 7.1 is no longer actively supported[1] (it receives only
security fixes).  Does this issue also happen with any actively
supported PHP version?

[1] <https://www.php.net/supported-versions.php>

------------------------------------------------------------------------
[2019-06-26 15:28:17] lozinskiy dot artem at gmail dot com

for example see this code

<?php
declare(ticks=1);
function my_function() {
    echo print_r(debug_backtrace(), 1) . '<br/>';
}
register_tick_function('my_function', true);
$t = false;
$check = ['a'];
foreach ($check as $e) {
    $t = false;
    if ($t===false) {
        break; // break;
    } else {
        delete_db(); // =)
    }
}
function delete_db() {}
---

analysis show me that execute delete_db, and this is problem
I see that in the alpha version of php 7.4 there is no such problem, all of a sudden, it pleases,
here now to get a patch for php 7.1

------------------------------------------------------------------------
[2019-06-26 14:56:08] lozinskiy dot artem at gmail dot com

>> Whatever the actual magical process is behind ticks, I don't think there's a bug
>> here.
Seriously, I made a convenient code analysis for myself using this function, but because of this
there is no bug, as you said, I cannot trust this analysis, for me this is a bug and a problem,
besides, only here is this behavior, and how can catch or identify this moment? How can I determine
that the function has been correctly reversed here and not here?

------------------------------------------------------------------------
[2019-06-26 14:48:49] requinix@php.net

Whatever the actual magical process is behind ticks, I don't think there's a bug here.

Look at https://3v4l.org/hneib/vld#output to see
exactly what PHP is doing with the code.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=78218


--
Edit this bug report at https://bugs.php.net/bug.php?id=78218&edit=1


Thread (17 messages)

« previous php.doc.bugs (#16784) next »