3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new StdClass; $obj->fn = function($arg) { return "Hello $arg"; }; echo ($obj->fn)('World');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4NXhD
function name:  (null)
number of ops:  12
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    4     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4NXhD%3A4%240'
          4        ASSIGN_OBJ                                               !0, 'fn'
          5        OP_DATA                                                  ~5
    5     6        FETCH_OBJ_R                                      ~6      !0, 'fn'
          7        INIT_DYNAMIC_CALL                                        ~6
          8        SEND_VAL_EX                                              'World'
          9        DO_FCALL                                      0  $7      
         10        ECHO                                                     $7
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4NXhD%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4NXhD
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'Hello+', !0
          3      > RETURN                                                   ~1
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4NXhD%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.42 ms | 1394 KiB | 13 Q