3v4l.org

run code in 300+ PHP versions simultaneously
<?php class toto { private $maman; private $papa; } $entity = new toto; function getVars($entity){ return \Closure::bind(function($entity) { return get_object_vars($entity); }, null, $entity); } var_dump(getVars($entity));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2iD7g
function name:  (null)
number of ops:  10
compiled vars:  !0 = $entity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'toto'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'getvars'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function getvars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2iD7g
function name:  getVars
number of ops:  9
compiled vars:  !0 = $entity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2iD7g%3A12%240'
   14     3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 null
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $2      
          7      > RETURN                                                   $2
   15     8*     > RETURN                                                   null

End of function getvars

Function %00%7Bclosure%7D%2Fin%2F2iD7g%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2iD7g
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $entity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'get_object_vars'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   14     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2iD7g%3A12%240

Class toto: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.38 ms | 1390 KiB | 18 Q