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 $json_frament_from_api; 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/5XqUX
function name:  (null)
number of ops:  36
compiled vars:  !0 = $json_fragment_from_api, !1 = $json_frament_from_api, !2 = $string, !3 = $json_from_api, !4 = $response, !5 = $perl_code, !6 = $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                                                     !1
    7     2        ECHO                                                     'Alex+Tartan%3A%0A'
    9     3        ASSIGN                                                   !2, !0
   10     4        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 '%5C%22'
          6        SEND_VAL                                                 '%22'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
   11    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 '%3D%3E'
         12        SEND_VAL                                                 '%3A'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !2, $11
   12    16        ECHO                                                     !2
   14    17        ECHO                                                     'ikegami%3A%0A'
   16    18        CONCAT                                           ~13     '%7B%22result%22%3A', !0
         19        CONCAT                                           ~14     ~13, '%7D'
         20        ASSIGN                                                   !3, ~14
   17    21        INIT_FCALL                                               'json_decode'
         22        SEND_VAR                                                 !3
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !4, $16
   18    26        FETCH_DIM_R                                      ~18     !4, 'result'
         27        ASSIGN                                                   !5, ~18
   19    28        INIT_FCALL                                               'str_replace'
         29        SEND_VAL                                                 '+%3D%3E'
         30        SEND_VAL                                                 '%3A'
         31        SEND_VAR                                                 !5
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !6, $20
   20    34        ECHO                                                     !6
   22    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.63 ms | 1400 KiB | 17 Q