3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = 'Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 192.168.1.1/24 u/u Local eth0.51 192.168.5.1/24 u/u Dev 1 eth1 x.x.x.x/24 u/u Internet eth2 192.168.2.1/24 u/D Local 2 lo 127.0.0.1/8 u/u ::1/128 tun35 192.168.4.222/24 u/u'; $string = 'eth'; $datastart = strpos($data,$string); $datastart = $datastart -1; $pattern ='lo 127.0.0.1/8 u/u ::1/128'; $replace = ''; echo "$pattern"; echo '<br />'; $data = substr($data,$datastart); $data = str_replace($pattern,$replace, $data); echo "$data";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/so2RL
function name:  (null)
number of ops:  28
compiled vars:  !0 = $data, !1 = $string, !2 = $datastart, !3 = $pattern, !4 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Codes%3A+S+-+State%2C+L+-+Link%2C+u+-+Up%2C+D+-+Down%2C+A+-+Admin+Down+Interface+IP++Address+S%2FL+Description+---------+----------+---+-----------+eth0+192.168.1.1%2F24+++u%2Fu+Local+eth0.51+192.168.5.1%2F24+u%2Fu+Dev+1+eth1+x.x.x.x%2F24+u%2Fu+Internet+eth2+192.168.2.1%2F24+u%2FD+Local+2+lo+127.0.0.1%2F8+u%2Fu+%3A%3A1%2F128+tun35+192.168.4.222%2F24+u%2Fu'
    4     1        ASSIGN                                                   !1, 'eth'
    6     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    7     7        SUB                                              ~9      !2, 1
          8        ASSIGN                                                   !2, ~9
    9     9        ASSIGN                                                   !3, 'lo+127.0.0.1%2F8+u%2Fu+%3A%3A1%2F128'
   10    10        ASSIGN                                                   !4, ''
   11    11        CAST                                          6  ~13     !3
         12        ECHO                                                     ~13
   13    13        ECHO                                                     '%3Cbr+%2F%3E'
   15    14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !0, $14
   16    19        INIT_FCALL                                               'str_replace'
         20        SEND_VAR                                                 !3
         21        SEND_VAR                                                 !4
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $16     
         24        ASSIGN                                                   !0, $16
   17    25        CAST                                          6  ~18     !0
         26        ECHO                                                     ~18
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.89 ms | 1396 KiB | 19 Q