3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matches = []; $string = "#HelloWorld -> helloworld, #Hello_W0rld -> hello_w0rld, #Hello(World -> hello,"; preg_replace_callback("/#([a-z_0-9]+)/i", function($res) use(&$matches) { $matches[] = strtolower($res[1]); }, $string); var_dump($matches); $matches2 = []; $string2 = "@HelloWorld -> helloworld, @Hello_W0rl.d -> hello_w0rl,"; preg_replace_callback("/@([a-z_0-9]+)/i", function($res) use(&$matches2) { $matches2[] = strtolower($res[1]); }, $string2); var_dump($matches2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZCA8
function name:  (null)
number of ops:  25
compiled vars:  !0 = $matches, !1 = $string, !2 = $matches2, !3 = $string2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, '%23HelloWorld+-%3E+helloworld%2C+%23Hello_W0rld+-%3E+hello_w0rld%2C+%23Hello%28World+-%3E+hello%2C'
    5     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%2F%23%28%5Ba-z_0-9%5D%2B%29%2Fi'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgZCA8%3A5%240'
          5        BIND_LEXICAL                                             ~6, !0
    7     6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
    9    12        ASSIGN                                                   !2, <array>
   10    13        ASSIGN                                                   !3, '%40HelloWorld+-%3E+helloworld%2C+%40Hello_W0rl.d+-%3E+hello_w0rl%2C'
   11    14        INIT_FCALL                                               'preg_replace_callback'
         15        SEND_VAL                                                 '%2F%40%28%5Ba-z_0-9%5D%2B%29%2Fi'
         16        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgZCA8%3A11%241'
         17        BIND_LEXICAL                                             ~11, !2
   13    18        SEND_VAL                                                 ~11
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
   14    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FgZCA8%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZCA8
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $res, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    6     2        INIT_FCALL                                               'strtolower'
          3        FETCH_DIM_R                                      ~3      !0, 1
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  $4
    7     8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FgZCA8%3A5%240

Function %00%7Bclosure%7D%2Fin%2FgZCA8%3A11%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZCA8
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $res, !1 = $matches2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   12     2        INIT_FCALL                                               'strtolower'
          3        FETCH_DIM_R                                      ~3      !0, 1
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  $4
   13     8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FgZCA8%3A11%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.49 ms | 1405 KiB | 19 Q