3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2FkeSgo%3A10%240

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.99 ms | 1385 KiB | 13 Q