3v4l.org

run code in 300+ PHP versions simultaneously
<?php class hell { private $ruler = 'devil'; function cry(){ echo $this->ruler; } } $inst = new hell(); $inst->cry(); $in2 = Closure::bind(function () {$this->ruler = 'jesus';}, $inst, get_class($inst)); $in2(); $inst->cry();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1jUu
function name:  (null)
number of ops:  18
compiled vars:  !0 = $inst, !1 = $in2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'hell'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        INIT_METHOD_CALL                                         !0, 'cry'
          4        DO_FCALL                                      0          
   15     5        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fr1jUu%3A15%240'
          7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !0
          9        GET_CLASS                                        ~7      !0
         10        SEND_VAL                                                 ~7
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !1, $8
   16    13        INIT_DYNAMIC_CALL                                        !1
         14        DO_FCALL                                      0          
   17    15        INIT_METHOD_CALL                                         !0, 'cry'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fr1jUu%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1jUu
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_THIS                                       $0      
          1        ASSIGN_OBJ                                               $0, 'ruler'
          2        OP_DATA                                                  'jesus'
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fr1jUu%3A15%240

Class hell:
Function cry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1jUu
function name:  cry
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'ruler'
          1        ECHO                                                     ~0
    8     2      > RETURN                                                   null

End of function cry

End of class hell.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.59 ms | 1395 KiB | 13 Q