3v4l.org

run code in 300+ PHP versions simultaneously
<?php function repl0($m) { return '&#'.$m[0]; } $s = 'This is a good 23200; sample ship'; echo "input1= ".htmlentities($s)."<br>"; $out1=preg_replace_callback('/(?<!#)(\d{4,5};)/','repl0',$s); echo 'output1 = '.htmlentities($out1).'<br>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRe0C
function name:  (null)
number of ops:  20
compiled vars:  !0 = $s, !1 = $out1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'This+is+a+good+23200%3B+sample+ship'
    7     1        INIT_FCALL                                               'htmlentities'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        CONCAT                                           ~4      'input1%3D+', $3
          5        CONCAT                                           ~5      ~4, '%3Cbr%3E'
          6        ECHO                                                     ~5
    8     7        INIT_FCALL                                               'preg_replace_callback'
          8        SEND_VAL                                                 '%2F%28%3F%3C%21%23%29%28%5Cd%7B4%2C5%7D%3B%29%2F'
          9        SEND_VAL                                                 'repl0'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
    9    13        INIT_FCALL                                               'htmlentities'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $8      
         16        CONCAT                                           ~9      'output1+%3D+', $8
         17        CONCAT                                           ~10     ~9, '%3Cbr%3E'
         18        ECHO                                                     ~10
         19      > RETURN                                                   1

Function repl0:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRe0C
function name:  repl0
number of ops:  5
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~1      !0, 0
          2        CONCAT                                           ~2      '%26%23', ~1
          3      > RETURN                                                   ~2
    5     4*     > RETURN                                                   null

End of function repl0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.36 ms | 1011 KiB | 15 Q