3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 1; protected $b = 2; public $c = 3; static public function get_public_vars($object) { $get_public_vars = Closure::bind(function($object) { return get_object_vars($object); }, null, 'stdClass'); return $get_public_vars($object); } } var_dump(A::get_public_vars(new A));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TgMqN
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'A', 'get_public_vars'
          2        NEW                                              $0      'A'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FTgMqN%3A11%240

Class A:
Function get_public_vars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TgMqN
function name:  get_public_vars
number of ops:  13
compiled vars:  !0 = $object, !1 = $get_public_vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTgMqN%3A11%240'
   13     3        SEND_VAL                                                 ~2
          4        SEND_VAL                                                 null
          5        SEND_VAL                                                 'stdClass'
          6        DO_FCALL                                      0  $3      
   11     7        ASSIGN                                                   !1, $3
   15     8        INIT_DYNAMIC_CALL                                        !1
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
   16    12*     > RETURN                                                   null

End of function get_public_vars

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.83 ms | 1396 KiB | 17 Q