3v4l.org

run code in 300+ PHP versions simultaneously
<?php class t { public $val; } $arr=array(); $a=new t(); $a->val=1; $arr[]=$a; $a=new t(); $a->val=2; $arr[]=$a; echo json_encode(arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XLdgh
function name:  (null)
number of ops:  21
compiled vars:  !0 = $arr, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        NEW                                              $3      't'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
    8     4        ASSIGN_OBJ                                               !1, 'val'
          5        OP_DATA                                                  1
    9     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  !1
   10     8        NEW                                              $8      't'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $8
   11    11        ASSIGN_OBJ                                               !1, 'val'
         12        OP_DATA                                                  2
   12    13        ASSIGN_DIM                                               !0
         14        OP_DATA                                                  !1
   14    15        INIT_FCALL                                               'json_encode'
         16        FETCH_CONSTANT                                   ~13     'arr'
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                         $14     
         19        ECHO                                                     $14
         20      > RETURN                                                   1

Class t: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.78 ms | 1395 KiB | 15 Q