3v4l.org

run code in 300+ PHP versions simultaneously
<?php function normalizeArray($ids) { $res = array(); $ids = (array) $ids; if (count($ids) > 0) { foreach ($ids as $id) { if (is_numeric($id)) { $res[] = (int) ($id); } } } return $res; } $s = ' '; $s = explode(',',$s); $i = normalizeArray($s); var_dump($i);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s7HFd
function name:  (null)
number of ops:  14
compiled vars:  !0 = $s, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, '+'
   19     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
   20     6        INIT_FCALL                                               'normalizearray'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !1, $5
   22    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function normalizearray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 18
filename:       /in/s7HFd
function name:  normalizeArray
number of ops:  20
compiled vars:  !0 = $ids, !1 = $res, !2 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    6     2        CAST                                          7  ~4      !0
          3        ASSIGN                                                   !0, ~4
    7     4        COUNT                                            ~6      !0
          5        IS_SMALLER                                               0, ~6
          6      > JMPZ                                                     ~7, ->18
    8     7    > > FE_RESET_R                                       $8      !0, ->17
          8    > > FE_FETCH_R                                               $8, !2, ->17
    9     9    >   INIT_FCALL                                               'is_numeric'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12      > JMPZ                                                     $9, ->16
   10    13    >   CAST                                          4  ~11     !2
         14        ASSIGN_DIM                                               !1
         15        OP_DATA                                                  ~11
    8    16    > > JMP                                                      ->8
         17    >   FE_FREE                                                  $8
   14    18    > > RETURN                                                   !1
   15    19*     > RETURN                                                   null

End of function normalizearray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.7 ms | 1403 KiB | 20 Q