3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $a = 'private'; } $getPrivate = Closure::bind(function($prop) { return $this->$prop; }, new Foo(), 'Foo'); echo $getPrivate('a');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bGMKv
function name:  (null)
number of ops:  14
compiled vars:  !0 = $getPrivate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbGMKv%3A6%240'
    8     2        SEND_VAL                                                 ~1
          3        NEW                                              $2      'Foo'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $2
          6        SEND_VAL                                                 'Foo'
          7        DO_FCALL                                      0  $4      
    6     8        ASSIGN                                                   !0, $4
    9     9        INIT_DYNAMIC_CALL                                        !0
         10        SEND_VAL_EX                                              'a'
         11        DO_FCALL                                      0  $6      
         12        ECHO                                                     $6
         13      > RETURN                                                   1

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

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.86 ms | 1385 KiB | 13 Q