3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(sprintf('%d.%d.%s-%d.%d.%d','11111','01','01','1d','','')); $a = '11111';//переполнение $b = '01'; //спереди 0 $c = '1d'; //лишние символы $d = ''; //недостаточно символов $e = 'df'; //неподходящие символы $r = array('/\d{4,1}/','/\d{2,1}/','/\d?/'); $i = 0; var_dump($r); echo preg_replace($r[0], '$0', $a).PHP_EOL; echo preg_replace($r[1], '$0', $b).PHP_EOL; echo preg_replace($r[1], '$0', $c).PHP_EOL; echo preg_replace($r[2], '$0', $d).PHP_EOL; echo preg_replace($r[1], '$0', $e).PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BafR2
function name:  (null)
number of ops:  63
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $r, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%25d.%25d.%25s-%25d.%25d.%25d'
          3        SEND_VAL                                                 '11111'
          4        SEND_VAL                                                 '01'
          5        SEND_VAL                                                 '01'
          6        SEND_VAL                                                 '1d'
          7        SEND_VAL                                                 ''
          8        SEND_VAL                                                 ''
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                                 
    3    12        ASSIGN                                                   !0, '11111'
    4    13        ASSIGN                                                   !1, '01'
    5    14        ASSIGN                                                   !2, '1d'
    6    15        ASSIGN                                                   !3, ''
    7    16        ASSIGN                                                   !4, 'df'
    8    17        ASSIGN                                                   !5, <array>
    9    18        ASSIGN                                                   !6, 0
   10    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !5
         21        DO_ICALL                                                 
   11    22        INIT_FCALL                                               'preg_replace'
         23        FETCH_DIM_R                                      ~17     !5, 0
         24        SEND_VAL                                                 ~17
         25        SEND_VAL                                                 '%240'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $18     
         28        CONCAT                                           ~19     $18, '%0A'
         29        ECHO                                                     ~19
   12    30        INIT_FCALL                                               'preg_replace'
         31        FETCH_DIM_R                                      ~20     !5, 1
         32        SEND_VAL                                                 ~20
         33        SEND_VAL                                                 '%240'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                         $21     
         36        CONCAT                                           ~22     $21, '%0A'
         37        ECHO                                                     ~22
   13    38        INIT_FCALL                                               'preg_replace'
         39        FETCH_DIM_R                                      ~23     !5, 1
         40        SEND_VAL                                                 ~23
         41        SEND_VAL                                                 '%240'
         42        SEND_VAR                                                 !2
         43        DO_ICALL                                         $24     
         44        CONCAT                                           ~25     $24, '%0A'
         45        ECHO                                                     ~25
   14    46        INIT_FCALL                                               'preg_replace'
         47        FETCH_DIM_R                                      ~26     !5, 2
         48        SEND_VAL                                                 ~26
         49        SEND_VAL                                                 '%240'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                         $27     
         52        CONCAT                                           ~28     $27, '%0A'
         53        ECHO                                                     ~28
   15    54        INIT_FCALL                                               'preg_replace'
         55        FETCH_DIM_R                                      ~29     !5, 1
         56        SEND_VAL                                                 ~29
         57        SEND_VAL                                                 '%240'
         58        SEND_VAR                                                 !4
         59        DO_ICALL                                         $30     
         60        CONCAT                                           ~31     $30, '%0A'
         61        ECHO                                                     ~31
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.13 ms | 1400 KiB | 19 Q