3v4l.org

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

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

End of function __sleep

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.82 ms | 1018 KiB | 16 Q