3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test implements Serializable { public $a; public function __construct( $_val ){ $this->a = $_val; } public function serialize() { $tmp = (object) array(); $tmp->a = $this->a; echo serialize( $tmp ) . "\n"; return serialize( $tmp ); } public function unserialize($var) {} } $n = array(); $n[] = new test("temp1"); $n[] = new test("temp2"); $n[] = new test("temp3"); $n[] = new test("temp4"); $n[] = new test("temp5"); $n[] = new test("temp6"); $n[] = new test("temp7"); $n[] = new test("temp8"); $n[] = new test("temp9"); print_r( unserialize( serialize( $n ) ) ); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJg0j
function name:  (null)
number of ops:  57
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   20     1        ASSIGN                                                   !0, <array>
   21     2        NEW                                              $3      'test'
          3        SEND_VAL_EX                                              'temp1'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $3
   22     7        NEW                                              $6      'test'
          8        SEND_VAL_EX                                              'temp2'
          9        DO_FCALL                                      0          
         10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  $6
   23    12        NEW                                              $9      'test'
         13        SEND_VAL_EX                                              'temp3'
         14        DO_FCALL                                      0          
         15        ASSIGN_DIM                                               !0
         16        OP_DATA                                                  $9
   24    17        NEW                                              $12     'test'
         18        SEND_VAL_EX                                              'temp4'
         19        DO_FCALL                                      0          
         20        ASSIGN_DIM                                               !0
         21        OP_DATA                                                  $12
   25    22        NEW                                              $15     'test'
         23        SEND_VAL_EX                                              'temp5'
         24        DO_FCALL                                      0          
         25        ASSIGN_DIM                                               !0
         26        OP_DATA                                                  $15
   26    27        NEW                                              $18     'test'
         28        SEND_VAL_EX                                              'temp6'
         29        DO_FCALL                                      0          
         30        ASSIGN_DIM                                               !0
         31        OP_DATA                                                  $18
   27    32        NEW                                              $21     'test'
         33        SEND_VAL_EX                                              'temp7'
         34        DO_FCALL                                      0          
         35        ASSIGN_DIM                                               !0
         36        OP_DATA                                                  $21
   28    37        NEW                                              $24     'test'
         38        SEND_VAL_EX                                              'temp8'
         39        DO_FCALL                                      0          
         40        ASSIGN_DIM                                               !0
         41        OP_DATA                                                  $24
   29    42        NEW                                              $27     'test'
         43        SEND_VAL_EX                                              'temp9'
         44        DO_FCALL                                      0          
         45        ASSIGN_DIM                                               !0
         46        OP_DATA                                                  $27
   30    47        INIT_FCALL                                               'print_r'
         48        INIT_FCALL                                               'unserialize'
         49        INIT_FCALL                                               'serialize'
         50        SEND_VAR                                                 !0
         51        DO_ICALL                                         $29     
         52        SEND_VAR                                                 $29
         53        DO_ICALL                                         $30     
         54        SEND_VAR                                                 $30
         55        DO_ICALL                                                 
   31    56      > RETURN                                                   1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJg0j
function name:  __construct
number of ops:  4
compiled vars:  !0 = $_val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'a'
          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/DJg0j
function name:  serialize
number of ops:  15
compiled vars:  !0 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   CAST                                          8  ~1      <array>
          1        ASSIGN                                                   !0, ~1
   12     2        FETCH_OBJ_R                                      ~4      'a'
          3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  ~4
   13     5        INIT_FCALL                                               'serialize'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        CONCAT                                           ~6      $5, '%0A'
          9        ECHO                                                     ~6
   14    10        INIT_FCALL                                               'serialize'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13      > RETURN                                                   $7
   15    14*     > 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/DJg0j
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function unserialize

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.2 ms | 1400 KiB | 19 Q