3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HelloWorld implements Serializable { public $test; public function __construct($str) { $this->test = $str; } public function serialize() { $simple = null; $simple = new Simple(); $simple->test = $this->test; return serialize($simple); } public function unserialize($str) { $simple = unserialize($str); $this->test = $simple->test; } } class Simple { public $test; } $list = array( new HelloWorld('str1'), new HelloWorld('str2'), new HelloWorld('str3'), new HelloWorld('str4'), new HelloWorld('str5'), new HelloWorld('str6'), new HelloWorld('str7'), new HelloWorld('str8'), new HelloWorld('str9'), ); $str = serialize($list); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e76Lh
function name:  (null)
number of ops:  43
compiled vars:  !0 = $list, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'helloworld'
   31     1        NEW                                              $2      'HelloWorld'
          2        SEND_VAL_EX                                              'str1'
          3        DO_FCALL                                      0          
          4        INIT_ARRAY                                       ~4      $2
   32     5        NEW                                              $5      'HelloWorld'
          6        SEND_VAL_EX                                              'str2'
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~4      $5
   33     9        NEW                                              $7      'HelloWorld'
         10        SEND_VAL_EX                                              'str3'
         11        DO_FCALL                                      0          
         12        ADD_ARRAY_ELEMENT                                ~4      $7
   34    13        NEW                                              $9      'HelloWorld'
         14        SEND_VAL_EX                                              'str4'
         15        DO_FCALL                                      0          
         16        ADD_ARRAY_ELEMENT                                ~4      $9
   35    17        NEW                                              $11     'HelloWorld'
         18        SEND_VAL_EX                                              'str5'
         19        DO_FCALL                                      0          
         20        ADD_ARRAY_ELEMENT                                ~4      $11
   36    21        NEW                                              $13     'HelloWorld'
         22        SEND_VAL_EX                                              'str6'
         23        DO_FCALL                                      0          
         24        ADD_ARRAY_ELEMENT                                ~4      $13
   37    25        NEW                                              $15     'HelloWorld'
         26        SEND_VAL_EX                                              'str7'
         27        DO_FCALL                                      0          
         28        ADD_ARRAY_ELEMENT                                ~4      $15
   38    29        NEW                                              $17     'HelloWorld'
         30        SEND_VAL_EX                                              'str8'
         31        DO_FCALL                                      0          
         32        ADD_ARRAY_ELEMENT                                ~4      $17
   39    33        NEW                                              $19     'HelloWorld'
         34        SEND_VAL_EX                                              'str9'
         35        DO_FCALL                                      0          
         36        ADD_ARRAY_ELEMENT                                ~4      $19
   30    37        ASSIGN                                                   !0, ~4
   42    38        INIT_FCALL                                               'serialize'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $22     
         41        ASSIGN                                                   !1, $22
   43    42      > RETURN                                                   1

Class HelloWorld:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e76Lh
function name:  __construct
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'test'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e76Lh
function name:  serialize
number of ops:  12
compiled vars:  !0 = $simple
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, null
   13     1        NEW                                              $2      'Simple'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   14     4        FETCH_OBJ_R                                      ~6      'test'
          5        ASSIGN_OBJ                                               !0, 'test'
          6        OP_DATA                                                  ~6
   15     7        INIT_FCALL                                               'serialize'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10      > RETURN                                                   $7
   16    11*     > 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/e76Lh
function name:  unserialize
number of ops:  9
compiled vars:  !0 = $str, !1 = $simple
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   21     5        FETCH_OBJ_R                                      ~5      !1, 'test'
          6        ASSIGN_OBJ                                               'test'
          7        OP_DATA                                                  ~5
   22     8      > RETURN                                                   null

End of function unserialize

End of class HelloWorld.

Class Simple: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.13 ms | 1400 KiB | 17 Q