3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class DemoFile { public static function doCount($vars) { if (count($vars) > 0) { } } public static function doForeach($vars) { foreach ($vars as $key => $val) { echo "hello"; } } } DemoFile::doForeach(new stdClass()); DemoFile::doCount(new stdClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bavqQ
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                      'DemoFile', 'doForeach'
          1        NEW                                                  $0      'stdClass'
          2        DO_FCALL                                          0          
          3        SEND_VAR                                                     $0
          4        DO_FCALL                                          0          
   20     5        INIT_STATIC_METHOD_CALL                                      'DemoFile', 'doCount'
          6        NEW                                                  $3      'stdClass'
          7        DO_FCALL                                          0          
          8        SEND_VAR                                                     $3
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class DemoFile:
Function docount:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 4
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/bavqQ
function name:  doCount
number of ops:  5
compiled vars:  !0 = $vars
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1        COUNT                                                ~1      !0
          2        IS_SMALLER                                                   0, ~1
          3      > JMPZ                                                         ~2, ->4
    9     4    > > RETURN                                                       null

End of function docount

Function doforeach:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/bavqQ
function name:  doForeach
number of ops:  8
compiled vars:  !0 = $vars, !1 = $val, !2 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   13     1      > FE_RESET_R                                           $3      !0, ->6
          2    > > FE_FETCH_R                                           ~4      $3, !1, ->6
          3    >   ASSIGN                                                       !2, ~4
   14     4        ECHO                                                         'hello'
   13     5      > JMP                                                          ->2
          6    >   FE_FREE                                                      $3
   16     7      > RETURN                                                       null

End of function doforeach

End of class DemoFile.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.52 ms | 3337 KiB | 13 Q