3v4l.org

run code in 300+ PHP versions simultaneously
<?php function profile($dump = FALSE) { static $profile; // Return the times stored in profile, then erase it if ($dump) { $temp = $profile; unset($profile); return ($temp); } $profile[] = microtime(); } // Set up a tick handler register_tick_function("profile"); // Initialize the function before the declare block profile(); // Run a block of code, throw a tick every 2nd statement declare(ticks=1) { $data = 0; ++$data; $data++; $data = $data + 1; $data+=1; } // Display the data stored in the profiler print_r(profile (TRUE));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mk7ml
function name:  (null)
number of ops:  23
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'register_tick_function'
          1        SEND_VAL                                                 'profile'
          2        DO_ICALL                                                 
   20     3        INIT_FCALL                                               'profile'
          4        DO_FCALL                                      0          
   24     5        ASSIGN                                                   !0, 0
          6        TICKS                                                    
   25     7        PRE_INC                                                  !0
          8        TICKS                                                    
   26     9        PRE_INC                                                  !0
         10        TICKS                                                    
   27    11        ADD                                              ~6      !0, 1
         12        ASSIGN                                                   !0, ~6
         13        TICKS                                                    
   28    14        ASSIGN_OP                                     1          !0, 1
         15        TICKS                                                    
   32    16        INIT_FCALL                                               'print_r'
         17        INIT_FCALL                                               'profile'
         18        SEND_VAL                                                 <true>
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function profile:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mk7ml
function name:  profile
number of ops:  11
compiled vars:  !0 = $dump, !1 = $profile, !2 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      <false>
    4     1        BIND_STATIC                                              !1
    7     2      > JMPZ                                                     !0, ->6
    8     3    >   ASSIGN                                                   !2, !1
    9     4        UNSET_CV                                                 !1
   10     5      > RETURN                                                   !2
   13     6    >   INIT_FCALL                                               'microtime'
          7        DO_ICALL                                         $5      
          8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  $5
   14    10      > RETURN                                                   null

End of function profile

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.85 ms | 1399 KiB | 21 Q