3v4l.org

run code in 300+ PHP versions simultaneously
<?php $permalink = 'permalink'; $text_link = 'text_link'; $links = array( '<li><a href="permalink">permalink1</a></li>', '<li><a href="permalink">permalink2</a></li>', '<li><a href="permalink">permalink3</a></li>', ); $total = count($links); for($permalink=0; $permalink<$total ;$permalink++){ $new_links[] = preg_replace('|<a>'.$total.'</a>|', '<a>'.$text_link.'</a>', $links[$permalink]); } print_r($new_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/nndC7
function name:  (null)
number of ops:  26
compiled vars:  !0 = $permalink, !1 = $text_link, !2 = $links, !3 = $total, !4 = $new_links
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                                            ~8      !2
          4        ASSIGN                                                   !3, ~8
   12     5        ASSIGN                                                   !0, 0
          6      > JMP                                                      ->20
   13     7    >   INIT_FCALL                                               'preg_replace'
          8        CONCAT                                           ~12     '%7C%3Ca%3E', !3
          9        CONCAT                                           ~13     ~12, '%3C%2Fa%3E%7C'
         10        SEND_VAL                                                 ~13
         11        CONCAT                                           ~14     '%3Ca%3E', !1
         12        CONCAT                                           ~15     ~14, '%3C%2Fa%3E'
         13        SEND_VAL                                                 ~15
         14        FETCH_DIM_R                                      ~16     !2, !0
         15        SEND_VAL                                                 ~16
         16        DO_ICALL                                         $17     
         17        ASSIGN_DIM                                               !4
         18        OP_DATA                                                  $17
   12    19        PRE_INC                                                  !0
         20    >   IS_SMALLER                                               !0, !3
         21      > JMPNZ                                                    ~19, ->7
   15    22    >   INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.16 ms | 1395 KiB | 17 Q