3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * @return array<string, mixed> */ function objectToArray(object $object): array { return (fn (): array => get_object_vars($this))->call($object); } final class A { private $a = 'incapsulated string'; } var_dump(objectToArray(new A()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/adhBn
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'objecttoarray'
          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 objecttoarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/adhBn
function name:  objectToArray
number of ops:  9
compiled vars:  !0 = $object
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    8     1        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          2        INIT_METHOD_CALL                                             ~1, 'call'
          3        SEND_VAR_EX                                                  !0
          4        DO_FCALL                                          0  $2      
          5        VERIFY_RETURN_TYPE                                           $2
          6      > RETURN                                                       $2
    9     7*       VERIFY_RETURN_TYPE                                           
          8*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/adhBn
function name:  {closure:objectToArray():8}
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'get_object_vars'
          1        FETCH_THIS                                           ~0      
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                             $1      
          4        VERIFY_RETURN_TYPE                                           $1
          5      > RETURN                                                       $1
          6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of Dynamic Function 0

End of function objecttoarray

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.38 ms | 482 KiB | 10 Q