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; ?>
Output for 8.3.0 - 8.3.4, 8.3.6
Alex Tartan: {"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"}ikegami: Warning: Trying to access array offset on null in /in/2g7J6 on line 16 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/2g7J6 on line 17
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Alex Tartan: {"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"}ikegami: Warning: Trying to access array offset on null in /in/2g7J6 on line 16 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/2g7J6 on line 17
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Alex Tartan: {"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"}ikegami: Warning: Trying to access array offset on value of type null in /in/2g7J6 on line 16 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/2g7J6 on line 17
Output for 8.0.0 - 8.0.30
Alex Tartan: {"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"}ikegami: Warning: Trying to access array offset on value of type null in /in/2g7J6 on line 16
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Alex Tartan: {"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"}ikegami: Notice: Trying to access array offset on value of type null in /in/2g7J6 on line 16
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.26
Alex Tartan: {"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"}ikegami:

preferences:
221.98 ms | 403 KiB | 291 Q