3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pj = array('title' => 'My Title Pj', 'price' => '4 $', 'comment' => 'Cool!', 'favicon' => './img/favicon-435.jpg'); $tmp = "Title.... {Title} \r\n"; $tmp .= "Price: {Price} \r\n"; $tmp .= "Comment: {Comment} \r\n"; foreach($pj as $k => $v){ $k = ucfirst($k); $tmp = str_replace("{" . $k . "}", $v, $tmp); } echo $tmp;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/12vTr
function name:  (null)
number of ops:  23
compiled vars:  !0 = $pj, !1 = $tmp, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 'Title....+%7BTitle%7D+%0D%0A'
    7     2        ASSIGN_OP                                     8          !1, 'Price%3A++%7BPrice%7D+%0D%0A'
    8     3        ASSIGN_OP                                     8          !1, 'Comment%3A+%7BComment%7D+%0D%0A'
   10     4      > FE_RESET_R                                       $8      !0, ->20
          5    > > FE_FETCH_R                                       ~9      $8, !2, ->20
          6    >   ASSIGN                                                   !3, ~9
   11     7        INIT_FCALL                                               'ucfirst'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !3, $11
   12    11        INIT_FCALL                                               'str_replace'
         12        CONCAT                                           ~13     '%7B', !3
         13        CONCAT                                           ~14     ~13, '%7D'
         14        SEND_VAL                                                 ~14
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !1, $15
   10    19      > JMP                                                      ->5
         20    >   FE_FREE                                                  $8
   17    21        ECHO                                                     !1
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.37 ms | 1395 KiB | 17 Q