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{1,4}).*/','/.*(\d{1,2}).*/','/(\d?)/'); 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/6Nc5E
function name:  (null)
number of ops:  59
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $r
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                                         $6      
         10        SEND_VAR                                                 $6
         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        INIT_FCALL                                               'preg_replace'
         19        FETCH_DIM_R                                      ~14     !5, 0
         20        SEND_VAL                                                 ~14
         21        SEND_VAL                                                 '%240'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $15     
         24        CONCAT                                           ~16     $15, '%0A'
         25        ECHO                                                     ~16
   10    26        INIT_FCALL                                               'preg_replace'
         27        FETCH_DIM_R                                      ~17     !5, 1
         28        SEND_VAL                                                 ~17
         29        SEND_VAL                                                 '%240'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $18     
         32        CONCAT                                           ~19     $18, '%0A'
         33        ECHO                                                     ~19
   11    34        INIT_FCALL                                               'preg_replace'
         35        FETCH_DIM_R                                      ~20     !5, 1
         36        SEND_VAL                                                 ~20
         37        SEND_VAL                                                 '%240'
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                         $21     
         40        CONCAT                                           ~22     $21, '%0A'
         41        ECHO                                                     ~22
   12    42        INIT_FCALL                                               'preg_replace'
         43        FETCH_DIM_R                                      ~23     !5, 2
         44        SEND_VAL                                                 ~23
         45        SEND_VAL                                                 '%240'
         46        SEND_VAR                                                 !3
         47        DO_ICALL                                         $24     
         48        CONCAT                                           ~25     $24, '%0A'
         49        ECHO                                                     ~25
   13    50        INIT_FCALL                                               'preg_replace'
         51        FETCH_DIM_R                                      ~26     !5, 1
         52        SEND_VAL                                                 ~26
         53        SEND_VAL                                                 '%240'
         54        SEND_VAR                                                 !4
         55        DO_ICALL                                         $27     
         56        CONCAT                                           ~28     $27, '%0A'
         57        ECHO                                                     ~28
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.67 ms | 1400 KiB | 19 Q