3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test = 0; } $a = new A; $func = function () {echo $this->test; }; $func->bindTo($a, 'A'); $func();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evMSS
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FevMSS%3A9%240'
          4        ASSIGN                                                   !1, ~5
   10     5        INIT_METHOD_CALL                                         !1, 'bindTo'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAL_EX                                              'A'
          8        DO_FCALL                                      0          
   11     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FevMSS%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evMSS
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'test'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FevMSS%3A9%240

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.16 ms | 1394 KiB | 13 Q