3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected $a = 10; protected $c;} class b { protected $b; public function setA($a){$this->b = $a;return $this;}} $q = (new b)->setA(new a); var_dump(unserialize(serialize($q), [true]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aeVVt
function name:  (null)
number of ops:  19
compiled vars:  !0 = $q
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'setA'
          3        NEW                                              $3      'a'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
    9     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'unserialize'
         10        INIT_FCALL                                               'serialize'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
         14        SEND_VAL                                                 <array>
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class a: [no user functions]
Class b:
Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aeVVt
function name:  setA
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'b'
          2        OP_DATA                                                  !0
          3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
          5*     > RETURN                                                   null

End of function seta

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1387 KiB | 19 Q