3v4l.org

run code in 300+ PHP versions simultaneously
<?php $permalink = 'permalink'; $text_link = 'text_link'; $links = array( '<li><a>total</a></li>', '<li><a href="permalink">permalink</a></li>', '<li><a href="permalink">permalink</a></li>', ); $total = count($links); for($permalink=1; $permalink<=$total ;$permalink++){ $links[] = preg_replace('|<a>'.$total.'</a>|', '<a>'.$text_link.'</a>', $links[$permalink]); } print_r($links);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 7
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 7
Branch analysis from position: 22
Branch analysis from position: 7
filename:       /in/8CofK
function name:  (null)
number of ops:  26
compiled vars:  !0 = $permalink, !1 = $text_link, !2 = $links, !3 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'permalink'
    3     1        ASSIGN                                                   !1, 'text_link'
    5     2        ASSIGN                                                   !2, <array>
   11     3        COUNT                                            ~7      !2
          4        ASSIGN                                                   !3, ~7
   12     5        ASSIGN                                                   !0, 1
          6      > JMP                                                      ->20
   13     7    >   INIT_FCALL                                               'preg_replace'
          8        CONCAT                                           ~11     '%7C%3Ca%3E', !3
          9        CONCAT                                           ~12     ~11, '%3C%2Fa%3E%7C'
         10        SEND_VAL                                                 ~12
         11        CONCAT                                           ~13     '%3Ca%3E', !1
         12        CONCAT                                           ~14     ~13, '%3C%2Fa%3E'
         13        SEND_VAL                                                 ~14
         14        FETCH_DIM_R                                      ~15     !2, !0
         15        SEND_VAL                                                 ~15
         16        DO_ICALL                                         $16     
         17        ASSIGN_DIM                                               !2
         18        OP_DATA                                                  $16
   12    19        PRE_INC                                                  !0
         20    >   IS_SMALLER_OR_EQUAL                                      !0, !3
         21      > JMPNZ                                                    ~18, ->7
   15    22    >   INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.71 ms | 1387 KiB | 17 Q