3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = new StdClass(); $lookup->blah = 12; $name = json_encode($lookup); var_dump($name); $name2 = json_decode($name); var_dump($name2); ?> btw, shorter way to output jsoned $lookup: <?= json_encode($lookup) ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0eDHf
function name:  (null)
number of ops:  25
compiled vars:  !0 = $lookup, !1 = $name, !2 = $name2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        ASSIGN_OBJ                                               !0, 'blah'
          4        OP_DATA                                                  12
    5     5        INIT_FCALL                                               'json_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !1, $7
    6     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
    7    12        INIT_FCALL                                               'json_decode'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !2, $10
    8    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   11    19        ECHO                                                     'btw%2C+shorter+way+to+output+jsoned+%24lookup%3A+%0A%0A'
   13    20        INIT_FCALL                                               'json_encode'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $13     
         23        ECHO                                                     $13
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.28 ms | 1395 KiB | 19 Q