3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_is_numerical($unsafeArray) { foreach($unsafeArray as $entry) { if (!is_numeric($entry)) { return false; } } return true; } $testArray = array(1,2,3,4,5); $testArray2 = array(1,2,3,'vier',5); $testNumber = 1; echo '(' . join(', ', $testArray) . ')'; echo '<br>'; echo(array_is_numerical($testArray)); echo '<br>'; echo(array_is_numerical($testArray2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2IWI
function name:  (null)
number of ops:  21
compiled vars:  !0 = $testArray, !1 = $testArray2, !2 = $testNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2        ASSIGN                                                   !2, 1
   18     3        INIT_FCALL                                               'join'
          4        SEND_VAL                                                 '%2C+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        CONCAT                                           ~7      '%28', $6
          8        CONCAT                                           ~8      ~7, '%29'
          9        ECHO                                                     ~8
   19    10        ECHO                                                     '%3Cbr%3E'
   20    11        INIT_FCALL                                               'array_is_numerical'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0  $9      
         14        ECHO                                                     $9
   21    15        ECHO                                                     '%3Cbr%3E'
   22    16        INIT_FCALL                                               'array_is_numerical'
         17        SEND_VAR                                                 !1
         18        DO_FCALL                                      0  $10     
         19        ECHO                                                     $10
         20      > RETURN                                                   1

Function array_is_numerical:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/r2IWI
function name:  array_is_numerical
number of ops:  14
compiled vars:  !0 = $unsafeArray, !1 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1      > FE_RESET_R                                       $2      !0, ->11
          2    > > FE_FETCH_R                                               $2, !1, ->11
    6     3    >   INIT_FCALL                                               'is_numeric'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6        BOOL_NOT                                         ~4      $3
          7      > JMPZ                                                     ~4, ->10
    7     8    >   FE_FREE                                                  $2
          9      > RETURN                                                   <false>
    5    10    > > JMP                                                      ->2
         11    >   FE_FREE                                                  $2
   10    12      > RETURN                                                   <true>
   11    13*     > RETURN                                                   null

End of function array_is_numerical

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.05 ms | 1403 KiB | 19 Q