3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new StdClass; $obj->fn = function($arg) { return "Hello $arg"; }; echo $obj->fn->call($obj, 'World'); echo PHP_EOL; echo ($obj->fn)();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6RgpA
function name:  (null)
number of ops:  18
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%2F6RgpA%3A4%240'
          4        ASSIGN_OBJ                                               !0, 'fn'
          5        OP_DATA                                                  ~5
    6     6        FETCH_OBJ_R                                      ~6      !0, 'fn'
          7        INIT_METHOD_CALL                                         ~6, 'call'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAL_EX                                              'World'
         10        DO_FCALL                                      0  $7      
         11        ECHO                                                     $7
    7    12        ECHO                                                     '%0A'
    8    13        FETCH_OBJ_R                                      ~8      !0, 'fn'
         14        INIT_DYNAMIC_CALL                                        ~8
         15        DO_FCALL                                      0  $9      
         16        ECHO                                                     $9
         17      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.2 ms | 1394 KiB | 13 Q