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; ?>
Output for git.master, git.master_jit
Warning: Undefined variable $json_frament_from_api in /in/5XqUX on line 5 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/5XqUX on line 18 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/5XqUX on line 19
Output for rfc.property-hooks
Warning: Undefined variable $json_frament_from_api in /in/5XqUX on line 5 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/5XqUX on line 18 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/5XqUX on line 19

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.28 ms | 402 KiB | 8 Q