3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static function bar($argument){ return 2*$argument; } } $class = 'foo'; $method = 'bar'; $lamda = function($argument)use($class, $method){return $class::$method($argument);};
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bAvts
function name:  (null)
number of ops:  7
compiled vars:  !0 = $class, !1 = $method, !2 = $lamda
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'foo'
    9     1        ASSIGN                                                   !1, 'bar'
   10     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbAvts%3A10%240'
          3        BIND_LEXICAL                                             ~5, !0
          4        BIND_LEXICAL                                             ~5, !1
          5        ASSIGN                                                   !2, ~5
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbAvts%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bAvts
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $argument, !1 = $class, !2 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        FETCH_CLASS                                   0  $3      !1
          4        INIT_STATIC_METHOD_CALL                                  $3, !2
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
          8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FbAvts%3A10%240

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

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.56 ms | 1394 KiB | 13 Q