3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nationalNumber = "4732691234"; $nationalNumberPattern = '[4589]\d{9}'; $final_pattern = '(?:' . $nationalNumberPattern . ')'; $final_pattern = '^' . $final_pattern . '$'; $final_pattern = '/' . $final_pattern . '/x'; $b = (preg_match($final_pattern, $nationalNumber, $groups, PREG_OFFSET_CAPTURE) == 1) ? true : false; var_dump($final_pattern, $nationalNumber, $b, $groups);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lHh35
function name:  (null)
number of ops:  30
compiled vars:  !0 = $nationalNumber, !1 = $nationalNumberPattern, !2 = $final_pattern, !3 = $b, !4 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '4732691234'
    6     1        ASSIGN                                                   !1, '%5B4589%5D%5Cd%7B9%7D'
    8     2        CONCAT                                           ~7      '%28%3F%3A', !1
          3        CONCAT                                           ~8      ~7, '%29'
          4        ASSIGN                                                   !2, ~8
    9     5        CONCAT                                           ~10     '%5E', !2
          6        CONCAT                                           ~11     ~10, '%24'
          7        ASSIGN                                                   !2, ~11
   10     8        CONCAT                                           ~13     '%2F', !2
          9        CONCAT                                           ~14     ~13, '%2Fx'
         10        ASSIGN                                                   !2, ~14
   11    11        INIT_FCALL                                               'preg_match'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !0
         14        SEND_REF                                                 !4
         15        SEND_VAL                                                 256
         16        DO_ICALL                                         $16     
         17        IS_EQUAL                                                 $16, 1
         18      > JMPZ                                                     ~17, ->21
         19    >   QM_ASSIGN                                        ~18     <true>
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~18     <false>
         22    >   ASSIGN                                                   !3, ~18
   13    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !3
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.78 ms | 1396 KiB | 17 Q