3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bla(callable $c) { echo json_encode([$c, $c()]); } bla(function($a) { echo "hi"; }); class d { function r() { echo "hello"; } } $e = new d(); bla([$e, 'r']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6Fsq
function name:  (null)
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'bla'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fo6Fsq%3A7%240'
    9     2        SEND_VAL                                                 ~1
          3        DO_FCALL                                      0          
   17     4        NEW                                              $3      'd'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   18     7        INIT_FCALL                                               'bla'
          8        INIT_ARRAY                                       ~6      !0
          9        ADD_ARRAY_ELEMENT                                ~6      'r'
         10        SEND_VAL                                                 ~6
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function bla:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6Fsq
function name:  bla
number of ops:  10
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'json_encode'
          2        INIT_ARRAY                                       ~1      !0
          3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0  $2      
          5        ADD_ARRAY_ELEMENT                                ~1      $2
          6        SEND_VAL                                                 ~1
          7        DO_ICALL                                         $3      
          8        ECHO                                                     $3
    5     9      > RETURN                                                   null

End of function bla

Function %00%7Bclosure%7D%2Fin%2Fo6Fsq%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6Fsq
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ECHO                                                     'hi'
    9     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fo6Fsq%3A7%240

Class d:
Function r:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6Fsq
function name:  r
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'hello'
   14     1      > RETURN                                                   null

End of function r

End of class d.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.71 ms | 1399 KiB | 17 Q