3v4l.org

run code in 500+ PHP versions simultaneously
<?php $phones = [ '2345678', '00000000', '00100000', '123456789', '000000000', '12345678901234567', ]; foreach ($phones as $phone) { $length = strlen($phone); echo (ctype_digit(ltrim($phone, '0')) && $length >= 8 && $length <= 16 ? 'Pass' : 'Fail') . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 25
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
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 = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
Branch analysis from position: 15
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/fEAsT
function name:  (null)
number of ops:  27
compiled vars:  !0 = $phones, !1 = $phone, !2 = $length
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1      > FE_RESET_R                                           $4      !0, ->25
          2    > > FE_FETCH_R                                                   $4, !1, ->25
   13     3    >   STRLEN                                               ~5      !1
          4        ASSIGN                                                       !2, ~5
   14     5        INIT_FCALL                                                   'ctype_digit'
          6        INIT_FCALL                                                   'ltrim'
          7        SEND_VAR                                                     !1
          8        SEND_VAL                                                     '0'
          9        DO_ICALL                                             $7      
         10        SEND_VAR                                                     $7
         11        DO_ICALL                                             $8      
         12      > JMPZ_EX                                              ~9      $8, ->15
         13    >   IS_SMALLER_OR_EQUAL                                  ~10     8, !2
         14        BOOL                                                 ~9      ~10
         15    > > JMPZ_EX                                              ~9      ~9, ->18
         16    >   IS_SMALLER_OR_EQUAL                                  ~11     !2, 16
         17        BOOL                                                 ~9      ~11
         18    > > JMPZ                                                         ~9, ->21
         19    >   QM_ASSIGN                                            ~12     'Pass'
         20      > JMP                                                          ->22
         21    >   QM_ASSIGN                                            ~12     'Fail'
         22    >   CONCAT                                               ~13     ~12, '%0A'
         23        ECHO                                                         ~13
   12    24      > JMP                                                          ->2
         25    >   FE_FREE                                                      $4
   15    26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
141.24 ms | 1756 KiB | 15 Q