3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "widgetTitle":"Recent History For You", "title_text":"Recent History", "title":"Recent History", "items":[ { "item_type":"product", "adunit_id":null, "name":"Dove Rejuvenated Volume Conditioner (240 ml)", "slug":"dove-rejuvenated-volume-conditioner-240-ml-86", "itemurl":"\/product\/dove-rejuvenated-volume-conditioner-240-ml-86", "category_name":"Conditioner", "stock_status":"1", "p_group":null, "thumb_image_url":"\/\/media6.ppl-media.com\/tr:h-235,w-235,c-at_max\/static\/img\/product\/141295\/dove-rejuvenated-volume-conditioner-240-ml_4_display_1476255016_7fe66d85.jpg", "primary_image_url":"\/\/media6.ppl-media.com\/tr:h-550,w-550,c-at_max\/static\/img\/product\/141295\/dove-rejuvenated-volume-conditioner-240-ml_4_display_1476255016_7fe66d85.jpg", "avg_rating":4, "total_rating":"13", "product_seller_id":"126619", "seller_id":"321", "price":"250", "mrp":"250", "offer_price":"200", "our_price":"200", "specialofferPrice":"200", "discount":"20", "offer_discount":0, "total_discount":20, "offer_text":"", "discount_price":50, "isincart":0, "iscart":0, "incart":0, "isliked":0 }, { "item_type":"product", "id":"107816", "adunit_id":null, "name":"Schwarzkopf Gliss Hair Repair With Liquid Keratin Serum Deep Repair Conditioner (200 ml)", "slug":"schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml", "itemurl":"\/product\/schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml", "category_name":"Conditioner", "stock_status":"1", "p_group":null, "thumb_image_url":"\/\/media6.ppl-media.com\/tr:h-235,w-235,c-at_max\/static\/img\/product\/107816\/schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml_1_display_1506591377_c984d6fc.jpg", "primary_image_url":"\/\/media6.ppl-media.com\/tr:h-550,w-550,c-at_max\/static\/img\/product\/107816\/schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml_1_display_1506591377_c984d6fc.jpg", "avg_rating":2.5, "total_rating":"3", "product_seller_id":"97130", "seller_id":"276", "price":"295", "mrp":"295", "offer_price":"266", "our_price":"266", "specialofferPrice":"266", "discount":"10", "offer_discount":0, "total_discount":10, "offer_text":"", "discount_price":29, "isincart":0, "iscart":0, "incart":0, "isliked":0 } ], "type":"Recent", "x_id":"1", "widget_id":"rh", "ictk":0, "cr":"", "if_from_cache":0, "version":"v_1", "widget_name":"rh", "reco_type":"rh", "widget_type":"product", "widget_view_type":"product", "text":"History", "page":"product", "status":"success" }'; $jsonArr = json_decode($json, true); $chars = preg_split('/product\//', $jsonArr['items'][0]['primary_image_url']); preg_match('/^\d+/', $chars[1], $matches); print_r($matches); $chars2 = preg_split('/product\//', $jsonArr['items'][1]['primary_image_url']); preg_match('/^\d+/', $chars2[1], $matches2); print_r($matches2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5tiLu
function name:  (null)
number of ops:  41
compiled vars:  !0 = $json, !1 = $jsonArr, !2 = $chars, !3 = $matches, !4 = $chars2, !5 = $matches2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A+++%22widgetTitle%22%3A%22Recent+History++For+You%22%2C%0A+++%22title_text%22%3A%22Recent+History%22%2C%0A+++%22title%22%3A%22Recent+History%22%2C%0A+++%22items%22%3A%5B%0A++++++%7B%0A+++++++++%22item_type%22%3A%22product%22%2C%0A+++++++++%22adunit_id%22%3Anull%2C%0A+++++++++%22name%22%3A%22Dove+Rejuvenated+Volume+Conditioner+%28240+ml%29%22%2C%0A+++++++++%22slug%22%3A%22dove-rejuvenated-volume-conditioner-240-ml-86%22%2C%0A+++++++++%22itemurl%22%3A%22%5C%2Fproduct%5C%2Fdove-rejuvenated-volume-conditioner-240-ml-86%22%2C%0A+++++++++%22category_name%22%3A%22Conditioner%22%2C%0A+++++++++%22stock_status%22%3A%221%22%2C%0A+++++++++%22p_group%22%3Anull%2C%0A+++++++++%22thumb_image_url%22%3A%22%5C%2F%5C%2Fmedia6.ppl-media.com%5C%2Ftr%3Ah-235%2Cw-235%2Cc-at_max%5C%2Fstatic%5C%2Fimg%5C%2Fproduct%5C%2F141295%5C%2Fdove-rejuvenated-volume-conditioner-240-ml_4_display_1476255016_7fe66d85.jpg%22%2C%0A+++++++++%22primary_image_url%22%3A%22%5C%2F%5C%2Fmedia6.ppl-media.com%5C%2Ftr%3Ah-550%2Cw-550%2Cc-at_max%5C%2Fstatic%5C%2Fimg%5C%2Fproduct%5C%2F141295%5C%2Fdove-rejuvenated-volume-conditioner-240-ml_4_display_1476255016_7fe66d85.jpg%22%2C%0A+++++++++%22avg_rating%22%3A4%2C%0A+++++++++%22total_rating%22%3A%2213%22%2C%0A+++++++++%22product_seller_id%22%3A%22126619%22%2C%0A+++++++++%22seller_id%22%3A%22321%22%2C%0A+++++++++%22price%22%3A%22250%22%2C%0A+++++++++%22mrp%22%3A%22250%22%2C%0A+++++++++%22offer_price%22%3A%22200%22%2C%0A+++++++++%22our_price%22%3A%22200%22%2C%0A+++++++++%22specialofferPrice%22%3A%22200%22%2C%0A+++++++++%22discount%22%3A%2220%22%2C%0A+++++++++%22offer_discount%22%3A0%2C%0A+++++++++%22total_discount%22%3A20%2C%0A+++++++++%22offer_text%22%3A%22%22%2C%0A+++++++++%22discount_price%22%3A50%2C%0A+++++++++%22isincart%22%3A0%2C%0A+++++++++%22iscart%22%3A0%2C%0A+++++++++%22incart%22%3A0%2C%0A+++++++++%22isliked%22%3A0%0A++++++%7D%2C%0A++++++%7B%0A+++++++++%22item_type%22%3A%22product%22%2C%0A+++++++++%22id%22%3A%22107816%22%2C%0A+++++++++%22adunit_id%22%3Anull%2C%0A+++++++++%22name%22%3A%22Schwarzkopf+Gliss+Hair+Repair+With+Liquid+Keratin+Serum+Deep+Repair+Conditioner+%28200+ml%29%22%2C%0A+++++++++%22slug%22%3A%22schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml%22%2C%0A+++++++++%22itemurl%22%3A%22%5C%2Fproduct%5C%2Fschwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml%22%2C%0A+++++++++%22category_name%22%3A%22Conditioner%22%2C%0A+++++++++%22stock_status%22%3A%221%22%2C%0A+++++++++%22p_group%22%3Anull%2C%0A+++++++++%22thumb_image_url%22%3A%22%5C%2F%5C%2Fmedia6.ppl-media.com%5C%2Ftr%3Ah-235%2Cw-235%2Cc-at_max%5C%2Fstatic%5C%2Fimg%5C%2Fproduct%5C%2F107816%5C%2Fschwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml_1_display_1506591377_c984d6fc.jpg%22%2C%0A+++++++++%22primary_image_url%22%3A%22%5C%2F%5C%2Fmedia6.ppl-media.com%5C%2Ftr%3Ah-550%2Cw-550%2Cc-at_max%5C%2Fstatic%5C%2Fimg%5C%2Fproduct%5C%2F107816%5C%2Fschwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml_1_display_1506591377_c984d6fc.jpg%22%2C%0A+++++++++%22avg_rating%22%3A2.5%2C%0A+++++++++%22total_rating%22%3A%223%22%2C%0A+++++++++%22product_seller_id%22%3A%2297130%22%2C%0A+++++++++%22seller_id%22%3A%22276%22%2C%0A+++++++++%22price%22%3A%22295%22%2C%0A+++++++++%22mrp%22%3A%22295%22%2C%0A+++++++++%22offer_price%22%3A%22266%22%2C%0A+++++++++%22our_price%22%3A%22266%22%2C%0A+++++++++%22specialofferPrice%22%3A%22266%22%2C%0A+++++++++%22discount%22%3A%2210%22%2C%0A+++++++++%22offer_discount%22%3A0%2C%0A+++++++++%22total_discount%22%3A10%2C%0A+++++++++%22offer_text%22%3A%22%22%2C%0A+++++++++%22discount_price%22%3A29%2C%0A+++++++++%22isincart%22%3A0%2C%0A+++++++++%22iscart%22%3A0%2C%0A+++++++++%22incart%22%3A0%2C%0A+++++++++%22isliked%22%3A0%0A++++++%7D%0A+++%5D%2C%0A+++%22type%22%3A%22Recent%22%2C%0A+++%22x_id%22%3A%221%22%2C%0A+++%22widget_id%22%3A%22rh%22%2C%0A+++%22ictk%22%3A0%2C%0A+++%22cr%22%3A%22%22%2C%0A+++%22if_from_cache%22%3A0%2C%0A+++%22version%22%3A%22v_1%22%2C%0A+++%22widget_name%22%3A%22rh%22%2C%0A+++%22reco_type%22%3A%22rh%22%2C%0A+++%22widget_type%22%3A%22product%22%2C%0A+++%22widget_view_type%22%3A%22product%22%2C%0A+++%22text%22%3A%22History%22%2C%0A+++%22page%22%3A%22product%22%2C%0A+++%22status%22%3A%22success%22%0A%7D'
   84     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
   86     6        INIT_FCALL                                               'preg_split'
          7        SEND_VAL                                                 '%2Fproduct%5C%2F%2F'
          8        FETCH_DIM_R                                      ~9      !1, 'items'
          9        FETCH_DIM_R                                      ~10     ~9, 0
         10        FETCH_DIM_R                                      ~11     ~10, 'primary_image_url'
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !2, $12
   87    14        INIT_FCALL                                               'preg_match'
         15        SEND_VAL                                                 '%2F%5E%5Cd%2B%2F'
         16        FETCH_DIM_R                                      ~14     !2, 1
         17        SEND_VAL                                                 ~14
         18        SEND_REF                                                 !3
         19        DO_ICALL                                                 
   88    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
   89    23        INIT_FCALL                                               'preg_split'
         24        SEND_VAL                                                 '%2Fproduct%5C%2F%2F'
         25        FETCH_DIM_R                                      ~17     !1, 'items'
         26        FETCH_DIM_R                                      ~18     ~17, 1
         27        FETCH_DIM_R                                      ~19     ~18, 'primary_image_url'
         28        SEND_VAL                                                 ~19
         29        DO_ICALL                                         $20     
         30        ASSIGN                                                   !4, $20
   90    31        INIT_FCALL                                               'preg_match'
         32        SEND_VAL                                                 '%2F%5E%5Cd%2B%2F'
         33        FETCH_DIM_R                                      ~22     !4, 1
         34        SEND_VAL                                                 ~22
         35        SEND_REF                                                 !5
         36        DO_ICALL                                                 
   91    37        INIT_FCALL                                               'print_r'
         38        SEND_VAR                                                 !5
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.74 ms | 1010 KiB | 17 Q