3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testString { public $a = true; function __sleep() { return array('a', '1'); } } class testInteger { public $a = true; function __sleep() { return array('a', 1); } } $cs = new testString(); $ci = new testInteger(); $ss = @serialize($cs); echo $ss . "\n"; $si = @serialize($ci); echo $si . "\n"; var_dump(unserialize($ss)); var_dump(unserialize($si));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8MsoA
function name:  (null)
number of ops:  35
compiled vars:  !0 = $cs, !1 = $ci, !2 = $ss, !3 = $si
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $4      'testString'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   24     3        NEW                                              $7      'testInteger'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $7
   26     6        BEGIN_SILENCE                                    ~10     
          7        INIT_FCALL                                               'serialize'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $11     
         10        END_SILENCE                                              ~10
         11        ASSIGN                                                   !2, $11
   27    12        CONCAT                                           ~13     !2, '%0A'
         13        ECHO                                                     ~13
   29    14        BEGIN_SILENCE                                    ~14     
         15        INIT_FCALL                                               'serialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $15     
         18        END_SILENCE                                              ~14
         19        ASSIGN                                                   !3, $15
   30    20        CONCAT                                           ~17     !3, '%0A'
         21        ECHO                                                     ~17
   32    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'unserialize'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $18     
         26        SEND_VAR                                                 $18
         27        DO_ICALL                                                 
   33    28        INIT_FCALL                                               'var_dump'
         29        INIT_FCALL                                               'unserialize'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                         $20     
         32        SEND_VAR                                                 $20
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Class testString:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8MsoA
function name:  __sleep
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   <array>
   10     1*     > RETURN                                                   null

End of function __sleep

End of class testString.

Class testInteger:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8MsoA
function name:  __sleep
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   <array>
   20     1*     > RETURN                                                   null

End of function __sleep

End of class testInteger.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.37 ms | 1400 KiB | 19 Q