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) { $functionname = explode('::', $functionname); } 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 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/aZcvZ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $functionname, !1 = $num
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                                         $4      
          6        TYPE_CHECK                                  1018          $4
          7      > JMPZ                                                     ~5, ->13
   12     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%3A%3A'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !0, $6
   15    13    >   INIT_USER_CALL                                0          'call_user_func_array', !0
         14        INIT_ARRAY                                       ~8      !1
         15        SEND_ARRAY                                               ~8
         16        CHECK_UNDEF_ARGS                                         
         17        DO_FCALL                                      0          
   17    18        ECHO                                                     !1
         19      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aZcvZ
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:
160.18 ms | 1387 KiB | 17 Q