3v4l.org

run code in 300+ 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}
number of ops:  22
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'sprintf'
    8     2        SEND_VAL                                                 '%3Cspan+class%3D%22%25s%22%3E%25s%3C%2Fspan%3E'
    9     3        NEW                                              $1      'NumberFormatter'
          4        SEND_VAL_EX                                              'en'
          5        FETCH_CLASS_CONSTANT                             ~2      'NumberFormatter', 'SPELLOUT'
          6        SEND_VAL_EX                                              ~2
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $1, 'format'
          9        CHECK_FUNC_ARG                                           
         10        FETCH_DIM_FUNC_ARG                               $4      !0, 1
         11        SEND_FUNC_ARG                                            $4
         12        DO_FCALL                                      0  $5      
         13        SEND_VAR                                                 $5
   10    14        INIT_FCALL                                               'htmlentities'
         15        FETCH_DIM_R                                      ~6      !0, 2
         16        SEND_VAL                                                 ~6
         17        DO_ICALL                                         $7      
         18        SEND_VAR                                                 $7
    7    19        DO_ICALL                                         $8      
   10    20      > RETURN                                                   $8
   11    21*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.65 ms | 1008 KiB | 16 Q