3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_fragment_from_api = '{\"caption\" => \"Genes (Comprehensive set from GENCODE 26)\",\"colour_key\" => \"[biotype]\",\"default\" => {\"MultiBottom\" => \"collapsed_label\",\"MultiTop\" => \"gene_label\",\"alignsliceviewbottom\" => \"as_collapsed_label\",\"contigviewbottom\" => \"transcript_label\",\"contigviewtop\" => \"gene_label\",\"cytoview\" => \"gene_label\"},\"key\" => \"ensembl\",\"label_key\" => \"[biotype]\",\"multi_name\" => \"GENCODE 26 Comprehensive gene set\",\"name\" => \"Comprehensive Gene Annotations from GENCODE 26\"}'; echo "Alex Tartan:\n"; $string = $json_fragment_from_api; $string = str_replace('\"','"', $string); $string = str_replace('=>',':', $string); echo $string; echo "ikegami:\n"; $json_from_api = '{"result":' . $json_fragment_from_api . '}'; $response = json_decode($json_from_api, true); $perl_code = $response["result"]; $desired_json = str_replace(' =>', ':', $perl_code); echo $desired_json; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2g7J6
function name:  (null)
number of ops:  35
compiled vars:  !0 = $json_fragment_from_api, !1 = $string, !2 = $json_from_api, !3 = $response, !4 = $perl_code, !5 = $desired_json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%5C%22caption%5C%22+%3D%3E+%5C%22Genes+%28Comprehensive+set+from+GENCODE+26%29%5C%22%2C%5C%22colour_key%5C%22+%3D%3E+%5C%22%5Bbiotype%5D%5C%22%2C%5C%22default%5C%22+%3D%3E+%7B%5C%22MultiBottom%5C%22+%3D%3E+%5C%22collapsed_label%5C%22%2C%5C%22MultiTop%5C%22+%3D%3E+%5C%22gene_label%5C%22%2C%5C%22alignsliceviewbottom%5C%22+%3D%3E+%5C%22as_collapsed_label%5C%22%2C%5C%22contigviewbottom%5C%22+%3D%3E+%5C%22transcript_label%5C%22%2C%5C%22contigviewtop%5C%22+%3D%3E+%5C%22gene_label%5C%22%2C%5C%22cytoview%5C%22+%3D%3E+%5C%22gene_label%5C%22%7D%2C%5C%22key%5C%22+%3D%3E+%5C%22ensembl%5C%22%2C%5C%22label_key%5C%22+%3D%3E+%5C%22%5Bbiotype%5D%5C%22%2C%5C%22multi_name%5C%22+%3D%3E+%5C%22GENCODE+26+Comprehensive+gene+set%5C%22%2C%5C%22name%5C%22+%3D%3E+%5C%22Comprehensive+Gene+Annotations+from+GENCODE+26%5C%22%7D'
    5     1        ECHO                                                     'Alex+Tartan%3A%0A'
    7     2        ASSIGN                                                   !1, !0
    8     3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 '%5C%22'
          5        SEND_VAL                                                 '%22'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
    9     9        INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 '%3D%3E'
         11        SEND_VAL                                                 '%3A'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !1, $10
   10    15        ECHO                                                     !1
   12    16        ECHO                                                     'ikegami%3A%0A'
   14    17        CONCAT                                           ~12     '%7B%22result%22%3A', !0
         18        CONCAT                                           ~13     ~12, '%7D'
         19        ASSIGN                                                   !2, ~13
   15    20        INIT_FCALL                                               'json_decode'
         21        SEND_VAR                                                 !2
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $15     
         24        ASSIGN                                                   !3, $15
   16    25        FETCH_DIM_R                                      ~17     !3, 'result'
         26        ASSIGN                                                   !4, ~17
   17    27        INIT_FCALL                                               'str_replace'
         28        SEND_VAL                                                 '+%3D%3E'
         29        SEND_VAL                                                 '%3A'
         30        SEND_VAR                                                 !4
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !5, $19
   18    33        ECHO                                                     !5
   20    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.37 ms | 1400 KiB | 17 Q