3v4l.org

run code in 500+ 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:/in/hbT7d:7}
number of ops:  13
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        FETCH_DIM_R                                          ~1      !0, 1
          2        FETCH_DIM_R                                          ~2      !0, 2
          3        DIV                                                  ~3      ~1, ~2
   10     4        FETCH_DIM_R                                          ~4      !0, 2
          5        ROPE_INIT                                         4  ~8      'Wires%3A+'
          6        CAST                                              4  ~5      ~3
          7        ROPE_ADD                                          1  ~8      ~8, ~5
          8        ROPE_ADD                                          2  ~8      ~8, '+Pairs%3A+'
          9        CAST                                              4  ~6      ~4
         10        ROPE_END                                          3  ~7      ~8, ~6
         11      > RETURN                                                       ~7
   11    12*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.88 ms | 1710 KiB | 14 Q