3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = new Curl(); $price_page = $c->get('http://www.kitco.com/market/'); //printr(htmlentities($price_page['response'])); //die(); //printr(htmlentities($price_page['response'])); if($price_page['response']){ $bits = explode("London Fix Prices",$price_page['response']); $usd = explode("London Fix Prices",$price_page['response']); $bits = explode("GBP",$bits[1]); $bits = explode("Euro",$bits[1]); $bits = explode("</td>",$bits[0]); $usd = explode("USD",$usd[1]); $usd = explode("GBP",$usd[1]); $usd = explode("</td>",$usd[0]); if(count($bits) == 10){ if(is_numeric(trim(strip_tags($bits[3]))) && is_numeric(trim(strip_tags($bits[1])))){ $ag_lme = trim(strip_tags($bits[3]))/31.103; // in grams $au_lme = trim(strip_tags($bits[1]))/31.103; // in grams $au_lme_usd = trim(strip_tags($usd[1])); $ag_lme_usd = trim(strip_tags($usd[3])); } else{ $error = "Prices not collected from kitco.com"; } } else{ $error = "Prices not collected from kitco.com"; } } else{ $error = "Prices not collected from kitco.com"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 122
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 120
Branch analysis from position: 60
2 jumps found. (Code = 46) Position 1 = 71, Position 2 = 82
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 118
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 119
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 82
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 122
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/80Ke4
function name:  (null)
number of ops:  124
compiled vars:  !0 = $c, !1 = $price_page, !2 = $bits, !3 = $usd, !4 = $ag_lme, !5 = $au_lme, !6 = $au_lme_usd, !7 = $ag_lme_usd, !8 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $9      'Curl'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $9
    5     3        INIT_METHOD_CALL                                         !0, 'get'
          4        SEND_VAL_EX                                              'http%3A%2F%2Fwww.kitco.com%2Fmarket%2F'
          5        DO_FCALL                                      0  $12     
          6        ASSIGN                                                   !1, $12
   11     7        FETCH_DIM_R                                      ~14     !1, 'response'
          8      > JMPZ                                                     ~14, ->122
   12     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 'London+Fix+Prices'
         11        FETCH_DIM_R                                      ~15     !1, 'response'
         12        SEND_VAL                                                 ~15
         13        DO_ICALL                                         $16     
         14        ASSIGN                                                   !2, $16
   13    15        INIT_FCALL                                               'explode'
         16        SEND_VAL                                                 'London+Fix+Prices'
         17        FETCH_DIM_R                                      ~18     !1, 'response'
         18        SEND_VAL                                                 ~18
         19        DO_ICALL                                         $19     
         20        ASSIGN                                                   !3, $19
   15    21        INIT_FCALL                                               'explode'
         22        SEND_VAL                                                 'GBP'
         23        FETCH_DIM_R                                      ~21     !2, 1
         24        SEND_VAL                                                 ~21
         25        DO_ICALL                                         $22     
         26        ASSIGN                                                   !2, $22
   16    27        INIT_FCALL                                               'explode'
         28        SEND_VAL                                                 'Euro'
         29        FETCH_DIM_R                                      ~24     !2, 1
         30        SEND_VAL                                                 ~24
         31        DO_ICALL                                         $25     
         32        ASSIGN                                                   !2, $25
   17    33        INIT_FCALL                                               'explode'
         34        SEND_VAL                                                 '%3C%2Ftd%3E'
         35        FETCH_DIM_R                                      ~27     !2, 0
         36        SEND_VAL                                                 ~27
         37        DO_ICALL                                         $28     
         38        ASSIGN                                                   !2, $28
   19    39        INIT_FCALL                                               'explode'
         40        SEND_VAL                                                 'USD'
         41        FETCH_DIM_R                                      ~30     !3, 1
         42        SEND_VAL                                                 ~30
         43        DO_ICALL                                         $31     
         44        ASSIGN                                                   !3, $31
   20    45        INIT_FCALL                                               'explode'
         46        SEND_VAL                                                 'GBP'
         47        FETCH_DIM_R                                      ~33     !3, 1
         48        SEND_VAL                                                 ~33
         49        DO_ICALL                                         $34     
         50        ASSIGN                                                   !3, $34
   21    51        INIT_FCALL                                               'explode'
         52        SEND_VAL                                                 '%3C%2Ftd%3E'
         53        FETCH_DIM_R                                      ~36     !3, 0
         54        SEND_VAL                                                 ~36
         55        DO_ICALL                                         $37     
         56        ASSIGN                                                   !3, $37
   23    57        COUNT                                            ~39     !2
         58        IS_EQUAL                                                 ~39, 10
         59      > JMPZ                                                     ~40, ->120
   24    60    >   INIT_FCALL                                               'is_numeric'
         61        INIT_FCALL                                               'trim'
         62        INIT_FCALL                                               'strip_tags'
         63        FETCH_DIM_R                                      ~41     !2, 3
         64        SEND_VAL                                                 ~41
         65        DO_ICALL                                         $42     
         66        SEND_VAR                                                 $42
         67        DO_ICALL                                         $43     
         68        SEND_VAR                                                 $43
         69        DO_ICALL                                         $44     
         70      > JMPZ_EX                                          ~45     $44, ->82
         71    >   INIT_FCALL                                               'is_numeric'
         72        INIT_FCALL                                               'trim'
         73        INIT_FCALL                                               'strip_tags'
         74        FETCH_DIM_R                                      ~46     !2, 1
         75        SEND_VAL                                                 ~46
         76        DO_ICALL                                         $47     
         77        SEND_VAR                                                 $47
         78        DO_ICALL                                         $48     
         79        SEND_VAR                                                 $48
         80        DO_ICALL                                         $49     
         81        BOOL                                             ~45     $49
         82    > > JMPZ                                                     ~45, ->118
   25    83    >   INIT_FCALL                                               'trim'
         84        INIT_FCALL                                               'strip_tags'
         85        FETCH_DIM_R                                      ~50     !2, 3
         86        SEND_VAL                                                 ~50
         87        DO_ICALL                                         $51     
         88        SEND_VAR                                                 $51
         89        DO_ICALL                                         $52     
         90        DIV                                              ~53     $52, 31.103
         91        ASSIGN                                                   !4, ~53
   26    92        INIT_FCALL                                               'trim'
         93        INIT_FCALL                                               'strip_tags'
         94        FETCH_DIM_R                                      ~55     !2, 1
         95        SEND_VAL                                                 ~55
         96        DO_ICALL                                         $56     
         97        SEND_VAR                                                 $56
         98        DO_ICALL                                         $57     
         99        DIV                                              ~58     $57, 31.103
        100        ASSIGN                                                   !5, ~58
   27   101        INIT_FCALL                                               'trim'
        102        INIT_FCALL                                               'strip_tags'
        103        FETCH_DIM_R                                      ~60     !3, 1
        104        SEND_VAL                                                 ~60
        105        DO_ICALL                                         $61     
        106        SEND_VAR                                                 $61
        107        DO_ICALL                                         $62     
        108        ASSIGN                                                   !6, $62
   28   109        INIT_FCALL                                               'trim'
        110        INIT_FCALL                                               'strip_tags'
        111        FETCH_DIM_R                                      ~64     !3, 3
        112        SEND_VAL                                                 ~64
        113        DO_ICALL                                         $65     
        114        SEND_VAR                                                 $65
        115        DO_ICALL                                         $66     
        116        ASSIGN                                                   !7, $66
        117      > JMP                                                      ->119
   31   118    >   ASSIGN                                                   !8, 'Prices+not+collected+from+kitco.com'
        119    > > JMP                                                      ->121
   35   120    >   ASSIGN                                                   !8, 'Prices+not+collected+from+kitco.com'
        121    > > JMP                                                      ->123
   39   122    >   ASSIGN                                                   !8, 'Prices+not+collected+from+kitco.com'
   40   123    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.41 ms | 1404 KiB | 21 Q