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[0] = new test("temp1"); $n[1] = new test("temp2"); print_r( unserialize( serialize( $n ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GeU1o
function name:  (null)
number of ops:  22
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, 0
          6        OP_DATA                                                  $3
   22     7        NEW                                              $6      'test'
          8        SEND_VAL_EX                                              'temp2'
          9        DO_FCALL                                      0          
         10        ASSIGN_DIM                                               !0, 1
         11        OP_DATA                                                  $6
   23    12        INIT_FCALL                                               'print_r'
         13        INIT_FCALL                                               'unserialize'
         14        INIT_FCALL                                               'serialize'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GeU1o
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/GeU1o
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/GeU1o
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:
143.95 ms | 1392 KiB | 19 Q