3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public $e; public function output() { $e = $this->e; echo $e('hi'); } } $t = new T; $t->e = function($str) { return str_reverse($str); }; $t->output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WmNHO
function name:  (null)
number of ops:  9
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWmNHO%3A12%240'
          4        ASSIGN_OBJ                                               !0, 'e'
          5        OP_DATA                                                  ~5
   13     6        INIT_METHOD_CALL                                         !0, 'output'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FWmNHO%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WmNHO
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        INIT_FCALL_BY_NAME                                       'str_reverse'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWmNHO%3A12%240

Class T:
Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WmNHO
function name:  output
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_R                                      ~1      'e'
          1        ASSIGN                                                   !0, ~1
    6     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_VAL_EX                                              'hi'
          4        DO_FCALL                                      0  $3      
          5        ECHO                                                     $3
    7     6      > RETURN                                                   null

End of function output

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1386 KiB | 13 Q