3v4l.org

run code in 300+ PHP versions simultaneously
<?php $desc = "+2.23% critical damage"; $count = 3; var_export( preg_replace_callback( '~^[+-]\d+(?:\.\d+)?~', function($m) use ($count) { return sprintf('%+.2f', $m[0] * $count); }, $desc, 1 ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Oun6R
function name:  (null)
number of ops:  14
compiled vars:  !0 = $desc, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2B2.23%25+critical+damage'
    4     1        ASSIGN                                                   !1, 3
    6     2        INIT_FCALL                                               'var_export'
    7     3        INIT_FCALL                                               'preg_replace_callback'
    8     4        SEND_VAL                                                 '%7E%5E%5B%2B-%5D%5Cd%2B%28%3F%3A%5C.%5Cd%2B%29%3F%7E'
    9     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
   11     7        SEND_VAL                                                 ~4
   12     8        SEND_VAR                                                 !0
   13     9        SEND_VAL                                                 1
    7    10        DO_ICALL                                         $5      
   13    11        SEND_VAR                                                 $5
    6    12        DO_ICALL                                                 
   15    13      > 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/Oun6R
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $m, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   10     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%25%2B.2f'
          4        FETCH_DIM_R                                      ~2      !0, 0
          5        MUL                                              ~3      !1, ~2
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   11     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.43 ms | 1007 KiB | 16 Q