3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Ololo { public function omg($a, $b, $c, $d, $e) { $a + $b + $c; } } xdebug_start_code_coverage(); $lang_id = $source = $lexemes_ids = $deadline_ts = $skip_lexem_ids = 1; $Obj = new Ololo(); $Obj->omg( $lang_id, $source, $lexemes_ids, $deadline_ts, $skip_lexem_ids ); $coverage = xdebug_get_code_coverage()[__FILE__]; xdebug_stop_code_coverage(); $lines = file(__FILE__); foreach ($lines as $idx => $l) { echo (isset($coverage[$idx + 1]) ? "\e[32m" : "\e[31m") . "$idx:$l"; } print_r($coverage);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 42
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 42
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/8YFSF
function name:  (null)
number of ops:  47
compiled vars:  !0 = $lang_id, !1 = $source, !2 = $lexemes_ids, !3 = $deadline_ts, !4 = $skip_lexem_ids, !5 = $Obj, !6 = $coverage, !7 = $lines, !8 = $l, !9 = $idx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL_BY_NAME                                       'xdebug_start_code_coverage'
          1        DO_FCALL                                      0          
   10     2        ASSIGN                                           ~11     !4, 1
          3        ASSIGN                                           ~12     !3, ~11
          4        ASSIGN                                           ~13     !2, ~12
          5        ASSIGN                                           ~14     !1, ~13
          6        ASSIGN                                                   !0, ~14
   11     7        NEW                                              $16     'Ololo'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !5, $16
   12    10        INIT_METHOD_CALL                                         !5, 'omg'
   13    11        SEND_VAR_EX                                              !0
         12        SEND_VAR_EX                                              !1
         13        SEND_VAR_EX                                              !2
         14        SEND_VAR_EX                                              !3
         15        SEND_VAR_EX                                              !4
   12    16        DO_FCALL                                      0          
   19    17        INIT_FCALL_BY_NAME                                       'xdebug_get_code_coverage'
         18        DO_FCALL                                      0  $20     
         19        FETCH_DIM_R                                      ~21     $20, '%2Fin%2F8YFSF'
         20        ASSIGN                                                   !6, ~21
   20    21        INIT_FCALL_BY_NAME                                       'xdebug_stop_code_coverage'
         22        DO_FCALL                                      0          
   21    23        INIT_FCALL                                               'file'
         24        SEND_VAL                                                 '%2Fin%2F8YFSF'
         25        DO_ICALL                                         $24     
         26        ASSIGN                                                   !7, $24
   22    27      > FE_RESET_R                                       $26     !7, ->42
         28    > > FE_FETCH_R                                       ~27     $26, !8, ->42
         29    >   ASSIGN                                                   !9, ~27
   23    30        ADD                                              ~29     !9, 1
         31        ISSET_ISEMPTY_DIM_OBJ                         0          !6, ~29
         32      > JMPZ                                                     ~30, ->35
         33    >   QM_ASSIGN                                        ~31     '%1B%5B32m'
         34      > JMP                                                      ->36
         35    >   QM_ASSIGN                                        ~31     '%1B%5B31m'
         36    >   ROPE_INIT                                     3  ~33     !9
         37        ROPE_ADD                                      1  ~33     ~33, '%3A'
         38        ROPE_END                                      2  ~32     ~33, !8
         39        CONCAT                                           ~35     ~31, ~32
         40        ECHO                                                     ~35
   22    41      > JMP                                                      ->28
         42    >   FE_FREE                                                  $26
   25    43        INIT_FCALL                                               'print_r'
         44        SEND_VAR                                                 !6
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Class Ololo:
Function omg:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8YFSF
function name:  omg
number of ops:  9
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
    6     5        ADD                                              ~5      !0, !1
          6        ADD                                              ~6      ~5, !2
          7        FREE                                                     ~6
    7     8      > RETURN                                                   null

End of function omg

End of class Ololo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.98 ms | 1451 KiB | 15 Q