3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'http://www.twitter.com/monica'; $text = preg_replace_callback( '~ (?<=^|\s) # positive looke behind, check for start of string or whitespace https?:// # match this caracters with an optional s (\S+) # capure group, all non whitespace chars ~ix', function ( $matches ) { return '<a href="' . esc_url( $matches[0] ) . '">' . $matches[1] . '</a>'; }, $text ); echo $text;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TZK5s
function name:  (null)
number of ops:  10
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.twitter.com%2Fmonica'
    4     1        INIT_FCALL                                               'preg_replace_callback'
    5     2        SEND_VAL                                                 '%7E%0A%09%09%09%28%3F%3C%3D%5E%7C%5Cs%29++%23+positive+looke+behind%2C+check+for+start+of+string+or+whitespace%0A%09%09%09https%3F%3A%2F%2F++%23+match+this+caracters+with+an+optional+s%0A%09%09%09%28%5CS%2B%29++++++%23+capure+group%2C+all+non+whitespace+chars%0A%09%09%09%7Eix'
   10     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTZK5s%3A10%240'
   12     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    4     7        ASSIGN                                                   !0, $3
   13     8        ECHO                                                     !0
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FTZK5s%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TZK5s
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL_BY_NAME                                       'esc_url'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_DIM_FUNC_ARG                               $1      !0, 0
          4        SEND_FUNC_ARG                                            $1
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      '%3Ca+href%3D%22', $2
          7        CONCAT                                           ~4      ~3, '%22%3E'
          8        FETCH_DIM_R                                      ~5      !0, 1
          9        CONCAT                                           ~6      ~4, ~5
         10        CONCAT                                           ~7      ~6, '%3C%2Fa%3E'
         11      > RETURN                                                   ~7
   12    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FTZK5s%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.41 ms | 1400 KiB | 15 Q