3v4l.org

run code in 300+ PHP versions simultaneously
<?php $so = new SimpleObject(); $so->setPriFloat(12.3); $so->setProInt(5); $so->setPubString('this is a test'); $obj = new \stdClass(); $obj->z = $so; $arr = array(new \stdClass(), array('a' => 1, 'b' => $so, 'c' => $obj), $so); $result = @json_encode($arr, 0, 4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NFROo
function name:  (null)
number of ops:  35
compiled vars:  !0 = $so, !1 = $obj, !2 = $arr, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'SimpleObject'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        INIT_METHOD_CALL                                         !0, 'setPriFloat'
          4        SEND_VAL_EX                                              12.3
          5        DO_FCALL                                      0          
    5     6        INIT_METHOD_CALL                                         !0, 'setProInt'
          7        SEND_VAL_EX                                              5
          8        DO_FCALL                                      0          
    6     9        INIT_METHOD_CALL                                         !0, 'setPubString'
         10        SEND_VAL_EX                                              'this+is+a+test'
         11        DO_FCALL                                      0          
    8    12        NEW                                              $10     'stdClass'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !1, $10
    9    15        ASSIGN_OBJ                                               !1, 'z'
         16        OP_DATA                                                  !0
   11    17        NEW                                              $14     'stdClass'
         18        DO_FCALL                                      0          
         19        INIT_ARRAY                                       ~16     $14
         20        INIT_ARRAY                                       ~17     1, 'a'
         21        ADD_ARRAY_ELEMENT                                ~17     !0, 'b'
         22        ADD_ARRAY_ELEMENT                                ~17     !1, 'c'
         23        ADD_ARRAY_ELEMENT                                ~16     ~17
         24        ADD_ARRAY_ELEMENT                                ~16     !0
         25        ASSIGN                                                   !2, ~16
   13    26        BEGIN_SILENCE                                    ~19     
         27        INIT_FCALL                                               'json_encode'
         28        SEND_VAR                                                 !2
         29        SEND_VAL                                                 0
         30        SEND_VAL                                                 4
         31        DO_ICALL                                         $20     
         32        END_SILENCE                                              ~19
         33        ASSIGN                                                   !3, $20
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.23 ms | 1401 KiB | 15 Q