3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FadhBn%3A8%240'
          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

End of function objecttoarray

Function %00%7Bclosure%7D%2Fin%2FadhBn%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/adhBn
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FadhBn%3A8%240

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.02 ms | 1399 KiB | 18 Q