3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return __METHOD__; } } function call(callable $func) { $func(); } $class = 'Foo'; $function = 'bar'; $classFuncArr = array($class, $function); $classFuncStr = $class . '::' . $function; var_dump($class::func()); var_dump($class::$function()); var_dump($classFuncArr()); //var_dump($classFuncStr()); var_dump(call($classFuncArr())); // var_dump(call($classFuncStr()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Aci
function name:  (null)
number of ops:  34
compiled vars:  !0 = $class, !1 = $function, !2 = $classFuncArr, !3 = $classFuncStr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'Foo'
   14     1        ASSIGN                                                   !1, 'bar'
   15     2        INIT_ARRAY                                       ~6      !0
          3        ADD_ARRAY_ELEMENT                                ~6      !1
          4        ASSIGN                                                   !2, ~6
   16     5        CONCAT                                           ~8      !0, '%3A%3A'
          6        CONCAT                                           ~9      ~8, !1
          7        ASSIGN                                                   !3, ~9
   18     8        INIT_FCALL                                               'var_dump'
          9        FETCH_CLASS                                   0  $11     !0
         10        INIT_STATIC_METHOD_CALL                                  $11, 'func'
         11        DO_FCALL                                      0  $12     
         12        SEND_VAR                                                 $12
         13        DO_ICALL                                                 
   19    14        INIT_FCALL                                               'var_dump'
         15        FETCH_CLASS                                   0  $14     !0
         16        INIT_STATIC_METHOD_CALL                                  $14, !1
         17        DO_FCALL                                      0  $15     
         18        SEND_VAR                                                 $15
         19        DO_ICALL                                                 
   20    20        INIT_FCALL                                               'var_dump'
         21        INIT_DYNAMIC_CALL                                        !2
         22        DO_FCALL                                      0  $17     
         23        SEND_VAR                                                 $17
         24        DO_ICALL                                                 
   23    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'call'
         27        INIT_DYNAMIC_CALL                                        !2
         28        DO_FCALL                                      0  $19     
         29        SEND_VAR                                                 $19
         30        DO_FCALL                                      0  $20     
         31        SEND_VAR                                                 $20
         32        DO_ICALL                                                 
   24    33      > RETURN                                                   1

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Aci
function name:  call
number of ops:  4
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   11     3      > RETURN                                                   null

End of function call

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Aci
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Foo%3A%3Abar'
    6     1*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.62 ms | 1403 KiB | 16 Q