3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new \stdClass(); $doc->docId = 111111; $doc->name = 'demo'; $doc2 = clone $doc; $docArray = []; $docArray[] = $doc; $docArray[] = $doc2; print_r($docArray); print_r((array) $doc2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CvMVq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $doc, !1 = $doc2, !2 = $docArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    5     3        ASSIGN_OBJ                                               !0, 'docId'
          4        OP_DATA                                                  111111
    6     5        ASSIGN_OBJ                                               !0, 'name'
          6        OP_DATA                                                  'demo'
    8     7        CLONE                                            ~8      !0
          8        ASSIGN                                                   !1, ~8
   10     9        ASSIGN                                                   !2, <array>
   12    10        ASSIGN_DIM                                               !2
         11        OP_DATA                                                  !0
   13    12        ASSIGN_DIM                                               !2
         13        OP_DATA                                                  !1
   15    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
   17    17        INIT_FCALL                                               'print_r'
         18        CAST                                          7  ~14     !1
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.59 ms | 1395 KiB | 15 Q