3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = 'callback({"country_code":"RU","country_name":"COUNTRY","city":"CITY","postal":null,"latitude":0.0000,"longitude":0.0000,"IPv4":"00.000.00.00","state":" REGION\'"})'; preg_match('/^\w+\((.*)\)$/', $json, $match); if (!$match) die('Malformed JSONP'); $data = json_decode($match[1], true); if (!$data) die ('Malformed JSON'); var_dump($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CXnLc
function name:  (null)
number of ops:  22
compiled vars:  !0 = $json, !1 = $match, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'callback%28%7B%22country_code%22%3A%22RU%22%2C%22country_name%22%3A%22COUNTRY%22%2C%22city%22%3A%22CITY%22%2C%22postal%22%3Anull%2C%22latitude%22%3A0.0000%2C%22longitude%22%3A0.0000%2C%22IPv4%22%3A%2200.000.00.00%22%2C%22state%22%3A%22+REGION%27%22%7D%29'
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%5Cw%2B%5C%28%28.%2A%29%5C%29%24%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        BOOL_NOT                                         ~5      !1
          7      > JMPZ                                                     ~5, ->9
          8    > > EXIT                                                     'Malformed+JSONP'
    7     9    >   INIT_FCALL                                               'json_decode'
         10        FETCH_DIM_R                                      ~6      !1, 1
         11        SEND_VAL                                                 ~6
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
    8    15        BOOL_NOT                                         ~9      !2
         16      > JMPZ                                                     ~9, ->18
         17    > > EXIT                                                     'Malformed+JSON'
    9    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.27 ms | 1395 KiB | 19 Q