3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format_text($string) { $string = preg_replace('/(\*\*(.*?)\*\*)/', '<b>\\2</b>', $string); $string = preg_replace('/(##(.*?)##)/', '<em>\\2</em>', $string); return $string; } $before = "Focus on the **user** and all else will ##follow##."; $after = format_text($before); echo $after;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hk9L1
function name:  (null)
number of ops:  7
compiled vars:  !0 = $before, !1 = $after
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'Focus+on+the+%2A%2Auser%2A%2A+and+all+else+will+%23%23follow%23%23.'
   11     1        INIT_FCALL                                               'format_text'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   13     5        ECHO                                                     !1
          6      > RETURN                                                   1

Function format_text:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hk9L1
function name:  format_text
number of ops:  15
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5C%2A%5C%2A%28.%2A%3F%29%5C%2A%5C%2A%29%2F'
          3        SEND_VAL                                                 '%3Cb%3E%5C2%3C%2Fb%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
    5     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%28%23%23%28.%2A%3F%29%23%23%29%2F'
          9        SEND_VAL                                                 '%3Cem%3E%5C2%3C%2Fem%3E'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $3      
         12        ASSIGN                                                   !0, $3
    6    13      > RETURN                                                   !0
    7    14*     > RETURN                                                   null

End of function format_text

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.01 ms | 1389 KiB | 16 Q