3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Obj { public function runAfter($callback) { $arg = microtime(); // Something random $callback($arg); } } $obj = new Obj(); for($i=0; $i<=3; $i++) { $obj->runafter(function($arg) use($i) { echo "$i is done and arg is $arg\n"; }); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
Branch analysis from position: 5
filename:       /in/QV66p
function name:  (null)
number of ops:  14
compiled vars:  !0 = $obj, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $2      'Obj'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   12     3        ASSIGN                                                       !1, 0
          4      > JMP                                                          ->11
   13     5    >   INIT_METHOD_CALL                                             !0, 'runafter'
          6        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          7        BIND_LEXICAL                                                 ~6, !1
   15     8        SEND_VAL_EX                                                  ~6
   13     9        DO_FCALL                                          0          
   12    10        PRE_INC                                                      !1
         11    >   IS_SMALLER_OR_EQUAL                                          !1, 3
         12      > JMPNZ                                                        ~9, ->5
   16    13    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QV66p
function name:  {closure:/in/QV66p:13}
number of ops:  8
compiled vars:  !0 = $arg, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   14     2        ROPE_INIT                                         4  ~3      !1
          3        ROPE_ADD                                          1  ~3      ~3, '+is+done+and+arg+is+'
          4        ROPE_ADD                                          2  ~3      ~3, !0
          5        ROPE_END                                          3  ~2      ~3, '%0A'
          6        ECHO                                                         ~2
   15     7      > RETURN                                                       null

End of Dynamic Function 0

Class Obj:
Function runafter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QV66p
function name:  runAfter
number of ops:  8
compiled vars:  !0 = $callback, !1 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'microtime'
          2        DO_ICALL                                             $2      
          3        ASSIGN                                                       !1, $2
    6     4        INIT_DYNAMIC_CALL                                            !0
          5        SEND_VAR_EX                                                  !1
          6        DO_FCALL                                          0          
    7     7      > RETURN                                                       null

End of function runafter

End of class Obj.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.78 ms | 1467 KiB | 14 Q