3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'Wires: 8 Pairs: 4'; echo preg_replace_callback( '/Wires: (\d+) Pairs: (\d+)/', fn($m) => sprintf( 'Wires: %d Pairs: %d', $m[1] / $m[2], $m[2] ), $input );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hbT7d
function name:  (null)
number of ops:  9
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Wires%3A+8+Pairs%3A+4'
    5     1        INIT_FCALL                                               'preg_replace_callback'
    6     2        SEND_VAL                                                 '%2FWires%3A+%28%5Cd%2B%29+Pairs%3A+%28%5Cd%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/hbT7d
function name:  {closure}
number of ops:  12
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                                                 'Wires%3A+%25d+Pairs%3A+%25d'
    9     3        FETCH_DIM_R                                      ~1      !0, 1
          4        FETCH_DIM_R                                      ~2      !0, 2
          5        DIV                                              ~3      ~1, ~2
          6        SEND_VAL                                                 ~3
   10     7        FETCH_DIM_R                                      ~4      !0, 2
          8        SEND_VAL                                                 ~4
    7     9        DO_ICALL                                         $5      
   10    10      > RETURN                                                   $5
   11    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.2 ms | 1003 KiB | 15 Q