3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = '#1Lorem Ipsum is simply dummy text#2printing and typesetting industry#0nothing#35That\'s a big one!'; echo preg_replace_callback( '/#(\d+)((?:(?!#\d).)+)/', fn($m) => sprintf( '<span class="%s">%s</span>', (new NumberFormatter("en", NumberFormatter::SPELLOUT))->format($m[1]), htmlentities($m[2]) ), $string );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tYPhU
function name:  (null)
number of ops:  9
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%231Lorem+Ipsum+is+simply+dummy+text%232printing+and+typesetting+industry%230nothing%2335That%27s+a+big+one%21'
    5     1        INIT_FCALL                                                   'preg_replace_callback'
    6     2        SEND_VAL                                                     '%2F%23%28%5Cd%2B%29%28%28%3F%3A%28%3F%21%23%5Cd%29.%29%2B%29%2F'
    7     3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   11     4        SEND_VAL                                                     ~2
   12     5        SEND_VAR                                                     !0
    5     6        DO_ICALL                                             $3      
   12     7        ECHO                                                         $3
   13     8      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tYPhU
function name:  {closure:/in/tYPhU:7}
number of ops:  22
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        NEW                                                  $1      'NumberFormatter'
          2        SEND_VAL_EX                                                  'en'
          3        FETCH_CLASS_CONSTANT                                 ~2      'NumberFormatter', 'SPELLOUT'
          4        SEND_VAL_EX                                                  ~2
          5        DO_FCALL                                          0          
          6        INIT_METHOD_CALL                                             $1, 'format'
          7        CHECK_FUNC_ARG                                               
          8        FETCH_DIM_FUNC_ARG                                   $4      !0, 1
          9        SEND_FUNC_ARG                                                $4
         10        DO_FCALL                                          0  $5      
   10    11        INIT_FCALL                                                   'htmlentities'
         12        FETCH_DIM_R                                          ~6      !0, 2
         13        SEND_VAL                                                     ~6
         14        DO_ICALL                                             $7      
         15        ROPE_INIT                                         5  ~9      '%3Cspan+class%3D%22'
         16        ROPE_ADD                                          1  ~9      ~9, $5
         17        ROPE_ADD                                          2  ~9      ~9, '%22%3E'
         18        ROPE_ADD                                          3  ~9      ~9, $7
         19        ROPE_END                                          4  ~8      ~9, '%3C%2Fspan%3E'
         20      > RETURN                                                       ~8
   11    21*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.21 ms | 1911 KiB | 15 Q