3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name= "xxx"; $title= "xxx"; $arrayGender = array("Boy","Girl"); $arrayName = array("John", "Rosy"); $obj = new stdClass; $obj->name = $name; $obj->title = $title; $obj->children = [$arrayGender, $arrayName]; echo json_encode($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o81QV
function name:  (null)
number of ops:  20
compiled vars:  !0 = $name, !1 = $title, !2 = $arrayGender, !3 = $arrayName, !4 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'xxx'
    3     1        ASSIGN                                                   !1, 'xxx'
    4     2        ASSIGN                                                   !2, <array>
    5     3        ASSIGN                                                   !3, <array>
    7     4        NEW                                              $9      'stdClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !4, $9
    8     7        ASSIGN_OBJ                                               !4, 'name'
          8        OP_DATA                                                  !0
    9     9        ASSIGN_OBJ                                               !4, 'title'
         10        OP_DATA                                                  !1
   10    11        INIT_ARRAY                                       ~15     !2
         12        ADD_ARRAY_ELEMENT                                ~15     !3
         13        ASSIGN_OBJ                                               !4, 'children'
         14        OP_DATA                                                  ~15
   12    15        INIT_FCALL                                               'json_encode'
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $16     
         18        ECHO                                                     $16
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.6 ms | 997 KiB | 14 Q