3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __sleep() { return "Baz"; } } class Bar implements Serializable{ public function serialize() { return "Baz"; } public function unserialize($data) { } } $foo = new Foo; $bar = new Bar; var_dump(serialize($foo)); var_dump(serialize($bar));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HSVMS
function name:  (null)
number of ops:  20
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'bar'
   19     1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   20     4        NEW                                              $5      'Bar'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   21     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'serialize'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                                 
   22    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'serialize'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class Foo:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HSVMS
function name:  __sleep
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Baz'
    6     1*     > RETURN                                                   null

End of function __sleep

End of class Foo.

Class Bar:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HSVMS
function name:  serialize
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'Baz'
   12     1*     > RETURN                                                   null

End of function serialize

Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HSVMS
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1      > RETURN                                                   null

End of function unserialize

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.89 ms | 1396 KiB | 17 Q