3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $a = 'a'; protected $b = 'b'; private $c = 'c'; } function objectToArray ($object) { $array = (array) $object; return array_combine( array_map( function($k) { return $k; }, array_keys($array) ), array_values($array) ); } $array = objectToArray( new \Test()); var_export((array) new \Test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RljXr
function name:  (null)
number of ops:  13
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'objecttoarray'
          1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        SEND_VAR                                                 $1
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !0, $3
   28     6        INIT_FCALL                                               'var_export'
          7        NEW                                              $5      'Test'
          8        DO_FCALL                                      0          
          9        CAST                                          7  ~7      $5
         10        SEND_VAL                                                 ~7
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function objecttoarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RljXr
function name:  objectToArray
number of ops:  20
compiled vars:  !0 = $object, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        CAST                                          7  ~2      !0
          2        ASSIGN                                                   !1, ~2
   16     3        INIT_FCALL                                               'array_combine'
   17     4        INIT_FCALL                                               'array_map'
   18     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRljXr%3A18%240'
          6        SEND_VAL                                                 ~4
   19     7        INIT_FCALL                                               'array_keys'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
   21    13        INIT_FCALL                                               'array_values'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                         $8      
         18      > RETURN                                                   $8
   23    19*     > RETURN                                                   null

End of function objecttoarray

Function %00%7Bclosure%7D%2Fin%2FRljXr%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RljXr
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRljXr%3A18%240

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.65 ms | 1403 KiB | 24 Q