3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example implements Serializable { /* Serializable */ public function serialize() { // We need to serialize everything because a run-time object of this class hasn't a reference return serialize(array( 'label' => 'a label', 'links' => 'some links', 'attrs' => 'some attrs', )); } public function unserialize($s) { return 'pie'; } } $o = new Example; $o->self = $o; echo serialize($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PV0m7
function name:  (null)
number of ops:  11
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'example'
   21     1        NEW                                              $1      'Example'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        ASSIGN_OBJ                                               !0, 'self'
          5        OP_DATA                                                  !0
   24     6        INIT_FCALL                                               'serialize'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

Class Example:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PV0m7
function name:  serialize
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'serialize'
   10     1        SEND_VAL                                                 <array>
          2        DO_ICALL                                         $0      
          3      > RETURN                                                   $0
   14     4*     > 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/PV0m7
function name:  unserialize
number of ops:  3
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1      > RETURN                                                   'pie'
   18     2*     > RETURN                                                   null

End of function unserialize

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.03 ms | 1395 KiB | 15 Q