3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = ['1,2', 1, '']; foreach ($number as $val) { if (!empty($val) || !ctype_alpha($val)) echo "val: $val is_numeric ".is_numeric(number_format($val))."\n\r"; } $number = 'abc1,2def'; $number = preg_replace("/[a-zA-Z]/i", '', $number); echo 'is numeric? '.is_numeric(number_format($number));
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 = 47) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 24
Branch analysis from position: 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/5MXYR
function name:  (null)
number of ops:  42
compiled vars:  !0 = $number, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $3      !0, ->25
          2    > > FE_FETCH_R                                               $3, !1, ->25
    5     3    >   ISSET_ISEMPTY_CV                                 ~4      !1
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPNZ_EX                                         ~5      ~5, ->11
          6    >   INIT_FCALL                                               'ctype_alpha'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        BOOL_NOT                                         ~7      $6
         10        BOOL                                             ~5      ~7
         11    > > JMPZ                                                     ~5, ->24
         12    >   ROPE_INIT                                     3  ~9      'val%3A+'
         13        ROPE_ADD                                      1  ~9      ~9, !1
         14        ROPE_END                                      2  ~8      ~9, '+is_numeric+'
         15        INIT_FCALL                                               'is_numeric'
         16        INIT_FCALL                                               'number_format'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                         $12     
         21        CONCAT                                           ~13     ~8, $12
         22        CONCAT                                           ~14     ~13, '%0A%0D'
         23        ECHO                                                     ~14
    4    24    > > JMP                                                      ->2
         25    >   FE_FREE                                                  $3
    8    26        ASSIGN                                                   !0, 'abc1%2C2def'
    9    27        INIT_FCALL                                               'preg_replace'
         28        SEND_VAL                                                 '%2F%5Ba-zA-Z%5D%2Fi'
         29        SEND_VAL                                                 ''
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $16     
         32        ASSIGN                                                   !0, $16
   10    33        INIT_FCALL                                               'is_numeric'
         34        INIT_FCALL                                               'number_format'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $18     
         37        SEND_VAR                                                 $18
         38        DO_ICALL                                         $19     
         39        CONCAT                                           ~20     'is+numeric%3F+', $19
         40        ECHO                                                     ~20
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.47 ms | 1461 KiB | 17 Q