3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [',3', '', 'text', '1,2', '2']; foreach ($arr as $val) { var_dump(is_numeric(($a = explode(',',$val)[0])) ? $a : 'none'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/ZVMCN
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $val, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > FE_RESET_R                                       $4      !0, ->20
          2    > > FE_FETCH_R                                               $4, !1, ->20
    4     3    >   INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'is_numeric'
          5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        FETCH_DIM_R                                      ~6      $5, 0
         10        ASSIGN                                           ~7      !2, ~6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13      > JMPZ                                                     $8, ->16
         14    >   QM_ASSIGN                                        ~9      !2
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~9      'none'
         17    >   SEND_VAL                                                 ~9
         18        DO_ICALL                                                 
    3    19      > JMP                                                      ->2
         20    >   FE_FREE                                                  $4
    5    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.02 ms | 1395 KiB | 19 Q