3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Some numbers: one: 1; two: 2; three: 3 end"; $ten = 10; $newstring = preg_replace_callback( '/(\\d+)/', function($match) use ($ten) { return (($match[0] + $ten)); }, $string ); echo $newstring; #prints "Some numbers: one: 11; two: 12; three: 13 end";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9r7Ej
function name:  (null)
number of ops:  12
compiled vars:  !0 = $string, !1 = $ten, !2 = $newstring
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Some+numbers%3A+one%3A+1%3B+two%3A+2%3B+three%3A+3+end'
    4     1        ASSIGN                                                   !1, 10
    5     2        INIT_FCALL                                               'preg_replace_callback'
    6     3        SEND_VAL                                                 '%2F%28%5Cd%2B%29%2F'
    7     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9r7Ej%3A7%240'
          5        BIND_LEXICAL                                             ~5, !1
          6        SEND_VAL                                                 ~5
    8     7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
    5     9        ASSIGN                                                   !2, $6
   10    10        ECHO                                                     !2
   11    11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F9r7Ej%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9r7Ej
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $match, !1 = $ten
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 0
          3        ADD                                              ~3      ~2, !1
          4      > RETURN                                                   ~3
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F9r7Ej%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.23 ms | 1395 KiB | 15 Q