3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isStringOrNumeric($in) { // Return true if $in is either a string or numeric return is_string($in) || is_numeric($in); } $a = array( 'one', 2, 'three', new Test()); $b = array_filter($a, 'isStringOrNumeric'); if($b === $a) echo('Success!'); else echo('Fail!');
Finding entry points
Branch analysis from position: 0
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 = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IKTro
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_ARRAY                                       ~2      'one'
          1        ADD_ARRAY_ELEMENT                                ~2      2
          2        ADD_ARRAY_ELEMENT                                ~2      'three'
          3        NEW                                              $3      'Test'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~2      $3
          6        ASSIGN                                                   !0, ~2
    9     7        INIT_FCALL                                               'array_filter'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'isStringOrNumeric'
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !1, $6
   11    12        IS_IDENTICAL                                             !1, !0
         13      > JMPZ                                                     ~8, ->16
   12    14    >   ECHO                                                     'Success%21'
         15      > JMP                                                      ->17
   14    16    >   ECHO                                                     'Fail%21'
         17    > > RETURN                                                   1

Function isstringornumeric:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/IKTro
function name:  isStringOrNumeric
number of ops:  9
compiled vars:  !0 = $in
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                   64  ~1      !0
          2      > JMPNZ_EX                                         ~1      ~1, ->7
          3    >   INIT_FCALL                                               'is_numeric'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        BOOL                                             ~1      $2
          7    > > RETURN                                                   ~1
    5     8*     > RETURN                                                   null

End of function isstringornumeric

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.57 ms | 1396 KiB | 17 Q