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); $class::$function($num); } else { $functionname($num); } echo $num;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EWIXO
function name:  (null)
number of ops:  27
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, ->22
   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        FETCH_CLASS                                   0  $13     !2
         18        INIT_STATIC_METHOD_CALL                                  $13, !3
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
         21      > JMP                                                      ->25
   15    22    >   INIT_DYNAMIC_CALL                                        !0
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0          
   18    25    >   ECHO                                                     !1
         26      > RETURN                                                   1

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