3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = file_get_contents('http://www.sparkfun.com/commerce/product_info.php?products_id=9279'); preg_match('#<tr><th>(.*)</th> <td><b>price</b></td></tr>#', $content, $match); $price = $match[1]; preg_match('#<input type="hidden" name="quantity_on_hand" value="(.*?)">#', $content, $match); $in_stock = $match[1]; echo "Price: $price - Availability: $in_stock\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9bOF
function name:  (null)
number of ops:  25
compiled vars:  !0 = $content, !1 = $match, !2 = $price, !3 = $in_stock
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.sparkfun.com%2Fcommerce%2Fproduct_info.php%3Fproducts_id%3D9279'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    5     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%23%3Ctr%3E%3Cth%3E%28.%2A%29%3C%2Fth%3E+%3Ctd%3E%3Cb%3Eprice%3C%2Fb%3E%3C%2Ftd%3E%3C%2Ftr%3E%23'
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
    6     9        FETCH_DIM_R                                      ~7      !1, 1
         10        ASSIGN                                                   !2, ~7
    8    11        INIT_FCALL                                               'preg_match'
         12        SEND_VAL                                                 '%23%3Cinput+type%3D%22hidden%22+name%3D%22quantity_on_hand%22+value%3D%22%28.%2A%3F%29%22%3E%23'
         13        SEND_VAR                                                 !0
         14        SEND_REF                                                 !1
         15        DO_ICALL                                                 
    9    16        FETCH_DIM_R                                      ~10     !1, 1
         17        ASSIGN                                                   !3, ~10
   11    18        ROPE_INIT                                     5  ~13     'Price%3A+'
         19        ROPE_ADD                                      1  ~13     ~13, !2
         20        ROPE_ADD                                      2  ~13     ~13, '+-+Availability%3A+'
         21        ROPE_ADD                                      3  ~13     ~13, !3
         22        ROPE_END                                      4  ~12     ~13, '%0A'
         23        ECHO                                                     ~12
   13    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.06 ms | 1395 KiB | 17 Q