3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo1 { public $a; public function __construct($a) { $this->a = $a; }} class foo2 { protected $a; public function __construct($a) { $this->a = $a; }} class foo3 { private $a; public function __construct($a) { $this->a = $a; }} $foo1 = new foo1("test"); $foo2 = new foo2("test"); $foo3 = new foo3("test"); var_dump(serialize($foo1)); var_dump(serialize($foo2)); var_dump(serialize($foo3)); var_dump(unserialize('O:4:"foo1":1:{s:1:"a";s:4:"test";}')); var_dump(unserialize('O:4:"foo2":1:{s:1:"a";s:4:"test";}')); var_dump(unserialize('O:4:"foo3":1:{s:1:"a";s:4:"test";}'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t2IPr
function name:  (null)
number of ops:  49
compiled vars:  !0 = $foo1, !1 = $foo2, !2 = $foo3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'foo1'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    8     4        NEW                                              $6      'foo2'
          5        SEND_VAL_EX                                              'test'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    9     8        NEW                                              $9      'foo3'
          9        SEND_VAL_EX                                              'test'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
   11    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'serialize'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $12     
         16        SEND_VAR                                                 $12
         17        DO_ICALL                                                 
   12    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'serialize'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        DO_ICALL                                                 
   13    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'serialize'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $16     
         28        SEND_VAR                                                 $16
         29        DO_ICALL                                                 
   15    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'unserialize'
         32        SEND_VAL                                                 'O%3A4%3A%22foo1%22%3A1%3A%7Bs%3A1%3A%22a%22%3Bs%3A4%3A%22test%22%3B%7D'
         33        DO_ICALL                                         $18     
         34        SEND_VAR                                                 $18
         35        DO_ICALL                                                 
   16    36        INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'unserialize'
         38        SEND_VAL                                                 'O%3A4%3A%22foo2%22%3A1%3A%7Bs%3A1%3A%22a%22%3Bs%3A4%3A%22test%22%3B%7D'
         39        DO_ICALL                                         $20     
         40        SEND_VAR                                                 $20
         41        DO_ICALL                                                 
   17    42        INIT_FCALL                                               'var_dump'
         43        INIT_FCALL                                               'unserialize'
         44        SEND_VAL                                                 'O%3A4%3A%22foo3%22%3A1%3A%7Bs%3A1%3A%22a%22%3Bs%3A4%3A%22test%22%3B%7D'
         45        DO_ICALL                                         $22     
         46        SEND_VAR                                                 $22
         47        DO_ICALL                                                 
         48      > RETURN                                                   1

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

End of function __construct

End of class foo1.

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

End of function __construct

End of class foo2.

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

End of function __construct

End of class foo3.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.21 ms | 1400 KiB | 19 Q