3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c1 { public $a = 1; public $b = 2; } class c2 implements Serializable { public function serialize() { return '{s:1:"a";i:1;s:1:"b";i:2;}'; } public function unserialize($str) {} } $o1 = new c1; $o2 = new c2; echo serialize($o1) . "\n"; echo serialize($o2) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UJY1K
function name:  (null)
number of ops:  18
compiled vars:  !0 = $o1, !1 = $o2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'c2'
   11     1        NEW                                              $2      'c1'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   12     4        NEW                                              $5      'c2'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   14     7        INIT_FCALL                                               'serialize'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        CONCAT                                           ~9      $8, '%0A'
         11        ECHO                                                     ~9
   15    12        INIT_FCALL                                               'serialize'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $10     
         15        CONCAT                                           ~11     $10, '%0A'
         16        ECHO                                                     ~11
         17      > RETURN                                                   1

Class c1: [no user functions]
Class c2:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UJY1K
function name:  serialize
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   '%7Bs%3A1%3A%22a%22%3Bi%3A1%3Bs%3A1%3A%22b%22%3Bi%3A2%3B%7D'
          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/UJY1K
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function unserialize

End of class c2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.37 ms | 1396 KiB | 15 Q