3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 = 29, Position 2 = 43
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 43
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/8YFSF
function name:  (null)
number of ops:  48
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
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
   9     1        INIT_FCALL_BY_NAME                                       'xdebug_start_code_coverage'
         2        DO_FCALL                                      0          
  10     3        ASSIGN                                           $12     !4, 1
         4        ASSIGN                                           $13     !3, $12
         5        ASSIGN                                           $14     !2, $13
         6        ASSIGN                                           $15     !1, $14
         7        ASSIGN                                                   !0, $15
  11     8        NEW                                              $17     :-2
         9        DO_FCALL                                      0          
        10        ASSIGN                                                   !5, $17
  12    11        INIT_METHOD_CALL                                         !5, 'omg'
  13    12        SEND_VAR_EX                                              !0
  14    13        SEND_VAR_EX                                              !1
  15    14        SEND_VAR_EX                                              !2
  16    15        SEND_VAR_EX                                              !3
  17    16        SEND_VAR_EX                                              !4
        17        DO_FCALL                                      0          
  19    18        INIT_FCALL_BY_NAME                                       'xdebug_get_code_coverage'
        19        DO_FCALL                                      0  $21     
        20        FETCH_DIM_R                                      $22     $21, '%2Fin%2F8YFSF'
        21        ASSIGN                                                   !6, $22
  20    22        INIT_FCALL_BY_NAME                                       'xdebug_stop_code_coverage'
        23        DO_FCALL                                      0          
  21    24        INIT_FCALL                                               'file'
        25        SEND_VAL                                                 '%2Fin%2F8YFSF'
        26        DO_ICALL                                         $25     
        27        ASSIGN                                                   !7, $25
  22    28      > FE_RESET_R                                       $27     !7, ->43
        29    > > FE_FETCH_R                                       ~28     $27, !8, ->43
        30    >   ASSIGN                                                   !9, ~28
  23    31        ADD                                              ~30     !9, 1
        32        ISSET_ISEMPTY_DIM_OBJ                       33554432  ~31     !6, ~30
        33      > JMPZ                                                     ~31, ->36
        34    >   QM_ASSIGN                                        ~32     '%1B%5B32m'
        35      > JMP                                                      ->37
        36    >   QM_ASSIGN                                        ~32     '%1B%5B31m'
        37    >   ROPE_INIT                                     3  ~34     !9
        38        ROPE_ADD                                      1  ~34     ~34, '%3A'
        39        ROPE_END                                      2  ~33     ~34, !8
        40        CONCAT                                           ~36     ~32, ~33
        41        ECHO                                                     ~36
        42      > JMP                                                      ->29
        43    >   FE_FREE                                                  $27
  25    44        INIT_FCALL                                               'print_r'
        45        SEND_VAR                                                 !6
        46        DO_ICALL                                                 
        47      > 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 7.3.0