3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ public static function Bar(&$v){ $v = 9000; } } $functionname = "Foo::Bar"; $num = 3; if (stristr($functionname, '::') !== false) { list($class, $function) = explode('::', $functionname); call_user_func_array($functionname, array(&$num)); } else { call_user_func_array($functionname, array(&$num)); } echo $num;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sgULI
function name:  (null)
number of ops:  30
compiled vars:  !0 = $functionname, !1 = $num, !2 = $class, !3 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'Foo%3A%3ABar'
    9     1        ASSIGN                                                   !1, 3
   11     2        INIT_FCALL                                               'stristr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%3A%3A'
          5        DO_ICALL                                         $6      
          6        TYPE_CHECK                                  1018          $6
          7      > JMPZ                                                     ~7, ->23
   12     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%3A%3A'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        FETCH_LIST_R                                     $9      $8, 0
         13        ASSIGN                                                   !2, $9
         14        FETCH_LIST_R                                     $11     $8, 1
         15        ASSIGN                                                   !3, $11
         16        FREE                                                     $8
   13    17        INIT_USER_CALL                                0          'call_user_func_array', !0
         18        INIT_ARRAY                                       ~13     !1
         19        SEND_ARRAY                                               ~13
         20        CHECK_UNDEF_ARGS                                         
         21        DO_FCALL                                      0          
         22      > JMP                                                      ->28
   15    23    >   INIT_USER_CALL                                0          'call_user_func_array', !0
         24        INIT_ARRAY                                       ~15     !1
         25        SEND_ARRAY                                               ~15
         26        CHECK_UNDEF_ARGS                                         
         27        DO_FCALL                                      0          
   18    28    >   ECHO                                                     !1
         29      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sgULI
function name:  Bar
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !0, 9000
    5     2      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1388 KiB | 17 Q