3v4l.org

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

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.82 ms | 1405 KiB | 17 Q