3v4l.org

run code in 300+ PHP versions simultaneously
<?php $phones = array('208-314-1243', '1294441454', '1343-132-123', 'a13-143-1234'); foreach ($phones as $phone) { $isValid = preg_match('/^\d{3}-?\d{3}-?\d{4}$/', $phone); echo "$phone is " . ($isValid ? '' : 'not') . " valid\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/H2Zer
function name:  (null)
number of ops:  20
compiled vars:  !0 = $phones, !1 = $phone, !2 = $isValid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > FE_RESET_R                                       $4      !0, ->18
          2    > > FE_FETCH_R                                               $4, !1, ->18
    4     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%5E%5Cd%7B3%7D-%3F%5Cd%7B3%7D-%3F%5Cd%7B4%7D%24%2F'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
    5     8        NOP                                                      
          9        FAST_CONCAT                                      ~7      !1, '+is+'
         10      > JMPZ                                                     !2, ->13
         11    >   QM_ASSIGN                                        ~8      ''
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      'not'
         14    >   CONCAT                                           ~9      ~7, ~8
         15        CONCAT                                           ~10     ~9, '+valid%0A'
         16        ECHO                                                     ~10
    3    17      > JMP                                                      ->2
         18    >   FE_FREE                                                  $4
    6    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.78 ms | 1395 KiB | 15 Q