3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public string $message = "yo"; function foo(callable $fn): void { $fn(); } function a() { $this->foo(function () { echo $this->message; }); } function b() { $this->foo(static function () { echo $this->message; }); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gTIVv
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   1

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

End of function foo

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gTIVv
function name:  a
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
          2        SEND_VAL_EX                                              ~0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gTIVv
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'message'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of Dynamic Function 0

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gTIVv
function name:  b
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
          2        SEND_VAL_EX                                              ~0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gTIVv
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'message'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of Dynamic Function 0

End of function b

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.62 ms | 1007 KiB | 13 Q