3v4l.org

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

Function bla:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQbXT
function name:  bla
number of ops:  6
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        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ECHO                                                     $1
    5     5      > RETURN                                                   null

End of function bla

Function %00%7Bclosure%7D%2Fin%2FUQbXT%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQbXT
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%2FUQbXT%3A7%240

Class d:
Function r:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQbXT
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:
152.21 ms | 1399 KiB | 17 Q