3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DummyClass {private $value = 1;} // Before PHP 7 $getValueCallBack = function() {return $this->value;}; $getValue = $getValueCallBack->bindTo(new DummyClass, 'DummyClass'); echo $getValue(); // From PHP 7 $getvalue = function() {return $this->value;}; echo $getValue->call(new DummyClass);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YKtPC
function name:  (null)
number of ops:  21
compiled vars:  !0 = $getValueCallBack, !1 = $getValue, !2 = $getvalue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYKtPC%3A6%240'
          1        ASSIGN                                                   !0, ~3
    7     2        INIT_METHOD_CALL                                         !0, 'bindTo'
          3        NEW                                              $5      'DummyClass'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $5
          6        SEND_VAL_EX                                              'DummyClass'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
    8     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
   11    12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYKtPC%3A11%241'
         13        ASSIGN                                                   !2, ~10
   12    14        INIT_METHOD_CALL                                         !1, 'call'
         15        NEW                                              $12     'DummyClass'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $12
         18        DO_FCALL                                      0  $14     
         19        ECHO                                                     $14
         20      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FYKtPC%3A6%240

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

End of function %00%7Bclosure%7D%2Fin%2FYKtPC%3A11%241

Class DummyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.62 ms | 1395 KiB | 13 Q