3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = array ( array ( 'product_id' => 'RD55559955', 'product_name' => 'Ontsteking (DI) Cassette Zwart Origineel Saab 9-3/9-5', 'price_excl' => 22600, 'product_brand' => 'Origineel Saab', ), array ( 'product_id' => 'RD55559955', 'product_name' => 'een ander product', 'price_excl' => 22600, 'product_brand' => 'Origineel Saab', ), array ( 'product_id' => 'RD55559955', 'product_name' => 'nog een ander product', 'price_excl' => 22600, 'product_brand' => 'Origineel Saab', ) ); $content = <<<CONTENT <div> ##PRODUCT_NAME## <br /> Onderdeel Nr: ##PRODUCT_ID## <br /> Merk: ##PRODUCT_BRAND## <br /> Prijs: €##PRODUCT_PRICE## <br /> </div> CONTENT; foreach ($products as $product) { echo str_replace( ['##PRODUCT_ID##', '##PRODUCT_NAME##', '##PRODUCT_PRICE##', '##PRODUCT_BRAND##'], [$product['product_id'], $product['product_name'], round($product['price_excl']/100, 2), $product['product_brand']], $content ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/CRFvU
function name:  (null)
number of ops:  26
compiled vars:  !0 = $products, !1 = $content, !2 = $product
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   30     1        ASSIGN                                                   !1, '%3Cdiv%3E%0A+++++%23%23PRODUCT_NAME%23%23+++++++++++++++++++++%3Cbr+%2F%3E++++%0A+++++Onderdeel+Nr%3A+%23%23PRODUCT_ID%23%23+++++++++%3Cbr+%2F%3E++%0A+++++Merk%3A+%23%23PRODUCT_BRAND%23%23++++++++++++++%3Cbr+%2F%3E++%0A+++++Prijs%3A+%E2%82%AC%23%23PRODUCT_PRICE%23%23++++++++++++%3Cbr+%2F%3E%0A%3C%2Fdiv%3E'
   39     2      > FE_RESET_R                                       $5      !0, ->24
          3    > > FE_FETCH_R                                               $5, !2, ->24
   40     4    >   INIT_FCALL                                               'str_replace'
   41     5        SEND_VAL                                                 <array>
   45     6        FETCH_DIM_R                                      ~6      !2, 'product_id'
          7        INIT_ARRAY                                       ~7      ~6
   46     8        FETCH_DIM_R                                      ~8      !2, 'product_name'
          9        ADD_ARRAY_ELEMENT                                ~7      ~8
   47    10        INIT_FCALL                                               'round'
         11        FETCH_DIM_R                                      ~9      !2, 'price_excl'
         12        DIV                                              ~10     ~9, 100
         13        SEND_VAL                                                 ~10
         14        SEND_VAL                                                 2
         15        DO_ICALL                                         $11     
         16        ADD_ARRAY_ELEMENT                                ~7      $11
   48    17        FETCH_DIM_R                                      ~12     !2, 'product_brand'
         18        ADD_ARRAY_ELEMENT                                ~7      ~12
         19        SEND_VAL                                                 ~7
   49    20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $13     
         22        ECHO                                                     $13
   39    23      > JMP                                                      ->3
         24    >   FE_FREE                                                  $5
   51    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.06 ms | 1401 KiB | 17 Q