3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo($param) { // do some special logic // and return either true or false return true; } } class B { function bar($var, $func) { $method = $func[0] . '::' . $func[1]; foreach($var as $v) { if(call_user_func($method, $v)) { echo 'OK'; } } } } class Start { function init() { $b = new B(); $test = array(1,2,3,4,5); $b->bar($test, ['A', 'foo']); } } Start::init();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WpeiD
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_STATIC_METHOD_CALL                                  'Start', 'init'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WpeiD
function name:  foo
number of ops:  3
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    7     1      > RETURN                                                   <true>
    8     2*     > RETURN                                                   null

End of function foo

End of class A.

Class B:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/WpeiD
function name:  bar
number of ops:  17
compiled vars:  !0 = $var, !1 = $func, !2 = $method, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        FETCH_DIM_R                                      ~4      !1, 0
          3        CONCAT                                           ~5      ~4, '%3A%3A'
          4        FETCH_DIM_R                                      ~6      !1, 1
          5        CONCAT                                           ~7      ~5, ~6
          6        ASSIGN                                                   !2, ~7
   15     7      > FE_RESET_R                                       $9      !0, ->15
          8    > > FE_FETCH_R                                               $9, !3, ->15
   16     9    >   INIT_USER_CALL                                1          'call_user_func', !2
         10        SEND_USER                                                !3
         11        DO_FCALL                                      0  $10     
         12      > JMPZ                                                     $10, ->14
   17    13    >   ECHO                                                     'OK'
   15    14    > > JMP                                                      ->8
         15    >   FE_FREE                                                  $9
   20    16      > RETURN                                                   null

End of function bar

End of class B.

Class Start:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WpeiD
function name:  init
number of ops:  9
compiled vars:  !0 = $b, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        ASSIGN                                                   !1, <array>
   28     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        SEND_VAR_EX                                              !1
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0          
   29     8      > RETURN                                                   null

End of function init

End of class Start.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.7 ms | 1399 KiB | 13 Q