3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 'This is $a from A'; public $b = 'This is $b from A'; public function __sleep(): array { var_dump(array_keys(get_object_vars($this))); return []; } } class B extends A { public $a = 'This is $a from B'; } $b = new B; serialize($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DBt3o
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_FCALL                                               'serialize'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class A:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DBt3o
function name:  __sleep
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'array_keys'
          2        INIT_FCALL                                               'get_object_vars'
          3        FETCH_THIS                                       ~0      
          4        SEND_VAL                                                 ~0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   12    10      > RETURN                                                   <array>
   13    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function __sleep

End of class A.

Class B:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DBt3o
function name:  __sleep
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'array_keys'
          2        INIT_FCALL                                               'get_object_vars'
          3        FETCH_THIS                                       ~0      
          4        SEND_VAL                                                 ~0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   12    10      > RETURN                                                   <array>
   13    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function __sleep

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.88 ms | 1457 KiB | 17 Q