3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Kitchen { private $value = 'cheese'; } $k = new Kitchen(); $m = function(){ echo 'called me. Value is ' . $this->value; }; Closure::bind($m, $k, $k); var_dump($m());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EBKqB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $k, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'Kitchen'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEBKqB%3A12%240'
          4        ASSIGN                                                   !1, ~5
   16     5        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   18    10        INIT_FCALL                                               'var_dump'
         11        INIT_DYNAMIC_CALL                                        !1
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FEBKqB%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EBKqB
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'value'
          2        CONCAT                                           ~2      'called+me.+Value+is+', ~1
          3        ECHO                                                     ~2
   14     4      > RETURN                                                   null

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

Class Kitchen: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.91 ms | 1395 KiB | 15 Q