3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "code": "200002 - VALUE_TOO_LONG", "title": "Der von Ihnen gepflegte Wert ist zu lang. K\u00fcrzen Sie die den Wert entsprechend der Zeichenbegrenzung aus der API-Dokumentation.", "path": "\/products", "jsonPath": "$.productVariations[?(@.sku==\"506163\")].productDescription.bulletPoints" }'; $decode = json_decode($json, true); $re = '/\$..*\[.*].(.*)/m'; preg_match($re, $decode['jsonPath'], $matches); if (!empty($matches)) { $field = $matches[1]; } var_dump($field);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/k5LlJ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $json, !1 = $decode, !2 = $re, !3 = $matches, !4 = $field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%7B%0A++++%22code%22%3A+%22200002+-+VALUE_TOO_LONG%22%2C%0A++++%22title%22%3A+%22Der+von+Ihnen+gepflegte+Wert+ist+zu+lang.+K%5Cu00fcrzen+Sie+die+den+Wert+entsprechend+der+Zeichenbegrenzung+aus+der+API-Dokumentation.%22%2C%0A++++%22path%22%3A+%22%5C%2Fproducts%22%2C%0A++++%22jsonPath%22%3A+%22%24.productVariations%5B%3F%28%40.sku%3D%3D%5C%22506163%5C%22%29%5D.productDescription.bulletPoints%22%0A%7D'
   11     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   13     6        ASSIGN                                                   !2, '%2F%5C%24..%2A%5C%5B.%2A%5D.%28.%2A%29%2Fm'
   15     7        INIT_FCALL                                               'preg_match'
          8        SEND_VAR                                                 !2
          9        FETCH_DIM_R                                      ~9      !1, 'jsonPath'
         10        SEND_VAL                                                 ~9
         11        SEND_REF                                                 !3
         12        DO_ICALL                                                 
   17    13        ISSET_ISEMPTY_CV                                 ~11     !3
         14        BOOL_NOT                                         ~12     ~11
         15      > JMPZ                                                     ~12, ->18
   18    16    >   FETCH_DIM_R                                      ~13     !3, 1
         17        ASSIGN                                                   !4, ~13
   21    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.17 ms | 1395 KiB | 19 Q