3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { private $e; private $charset = "UTF-8"; public function output() { $e = $this->e; echo $e('hi'); } public function setEscaper(Closure $close) { $this->e = $close->bindTo($this); } public function getCharset() { return $this->charset; } } $t = new T; $t->setEscaper(function($str) { return $this->getCharset(); }); $t->output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3gUpK
function name:  (null)
number of ops:  10
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'setEscaper'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3gUpK%3A21%240'
          5        SEND_VAL_EX                                              ~4
          6        DO_FCALL                                      0          
   22     7        INIT_METHOD_CALL                                         !0, 'output'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F3gUpK%3A21%240

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

End of function output

Function setescaper:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3gUpK
function name:  setEscaper
number of ops:  8
compiled vars:  !0 = $close
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_METHOD_CALL                                         !0, 'bindTo'
          2        FETCH_THIS                                       $2      
          3        SEND_VAR_EX                                              $2
          4        DO_FCALL                                      0  $3      
          5        ASSIGN_OBJ                                               'e'
          6        OP_DATA                                                  $3
   12     7      > RETURN                                                   null

End of function setescaper

Function getcharset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3gUpK
function name:  getCharset
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'charset'
          1      > RETURN                                                   ~0
   16     2*     > RETURN                                                   null

End of function getcharset

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.75 ms | 1399 KiB | 13 Q