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(); $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/MdBE1
function name:  (null)
number of ops:  32
compiled vars:  !0 = $cs, !1 = $ss, !2 = $si, !3 = $ci
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        BEGIN_SILENCE                                    ~7      
          4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $8      
          7        END_SILENCE                                              ~7
          8        ASSIGN                                                   !1, $8
   25     9        CONCAT                                           ~10     !1, '%0A'
         10        ECHO                                                     ~10
   27    11        BEGIN_SILENCE                                    ~11     
         12        INIT_FCALL                                               'serialize'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $12     
         15        END_SILENCE                                              ~11
         16        ASSIGN                                                   !2, $12
   28    17        CONCAT                                           ~14     !2, '%0A'
         18        ECHO                                                     ~14
   30    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'unserialize'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $15     
         23        SEND_VAR                                                 $15
         24        DO_ICALL                                                 
   31    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'unserialize'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                         $17     
         29        SEND_VAR                                                 $17
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class testString:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdBE1
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/MdBE1
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:
155.92 ms | 1405 KiB | 19 Q