3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = '--ACT-- active --INA-- inactive --ACT-- active --INA-- inactive --INA-- inactive'; Echo preg_replace("/--INA-- (\w+)/" , '<div class="wp"><b>2</b>$1</div>',preg_replace("/--ACT-- (\w+)/" , '<div class="wp"><b>1</b>$1</div>',$text)) . "\n"; Echo preg_replace("/.*--INA-- (\w+).*/" , '<div class="wp"><b>2</b>$1</div>',preg_replace("/.*--ACT-- (\w+).*/" , '<div class="wp"><b>1</b>$1</div>',$text)) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7BMU
function name:  (null)
number of ops:  14
compiled vars:  !0 = $text
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '--ACT--+active+--INA--+inactive+--ACT--+active+--INA--+inactive+--INA--+inactive'
    5     1        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F--ACT--+%28%5Cw%2B%29%2F', '%3Cdiv+class%3D%22wp%22%3E%3Cb%3E1%3C%2Fb%3E%241%3C%2Fdiv%3E'
          2        OP_DATA                                                      !0
          3        FRAMELESS_ICALL_3                preg_replace        ~3      '%2F--INA--+%28%5Cw%2B%29%2F', '%3Cdiv+class%3D%22wp%22%3E%3Cb%3E2%3C%2Fb%3E%241%3C%2Fdiv%3E'
          4        OP_DATA                                                      ~2
          5        CONCAT                                               ~4      ~3, '%0A'
          6        ECHO                                                         ~4
    6     7        FRAMELESS_ICALL_3                preg_replace        ~5      '%2F.%2A--ACT--+%28%5Cw%2B%29.%2A%2F', '%3Cdiv+class%3D%22wp%22%3E%3Cb%3E1%3C%2Fb%3E%241%3C%2Fdiv%3E'
          8        OP_DATA                                                      !0
          9        FRAMELESS_ICALL_3                preg_replace        ~6      '%2F.%2A--INA--+%28%5Cw%2B%29.%2A%2F', '%3Cdiv+class%3D%22wp%22%3E%3Cb%3E2%3C%2Fb%3E%241%3C%2Fdiv%3E'
         10        OP_DATA                                                      ~5
         11        CONCAT                                               ~7      ~6, '%0A'
         12        ECHO                                                         ~7
         13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
230.21 ms | 2593 KiB | 13 Q