3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isInteger($a){ return (string)(int)$a === (string)$a; } var_dump(isInteger(10)); var_dump(isInteger(10.01)); var_dump(isInteger("10")); var_dump(isInteger("10.01")); var_dump(isInteger(0x10)); var_dump(isInteger("0x10")); var_dump(isInteger('a')); var_dump(isInteger(null)); var_dump(isInteger(false));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZnKvD
function name:  (null)
number of ops:  55
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'isinteger'
          2        SEND_VAL                                                 10
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'isinteger'
          8        SEND_VAL                                                 10.01
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
    9    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'isinteger'
         14        SEND_VAL                                                 '10'
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   10    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'isinteger'
         20        SEND_VAL                                                 '10.01'
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                                 
   11    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'isinteger'
         26        SEND_VAL                                                 16
         27        DO_FCALL                                      0  $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
   12    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'isinteger'
         32        SEND_VAL                                                 '0x10'
         33        DO_FCALL                                      0  $10     
         34        SEND_VAR                                                 $10
         35        DO_ICALL                                                 
   13    36        INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'isinteger'
         38        SEND_VAL                                                 'a'
         39        DO_FCALL                                      0  $12     
         40        SEND_VAR                                                 $12
         41        DO_ICALL                                                 
   14    42        INIT_FCALL                                               'var_dump'
         43        INIT_FCALL                                               'isinteger'
         44        SEND_VAL                                                 null
         45        DO_FCALL                                      0  $14     
         46        SEND_VAR                                                 $14
         47        DO_ICALL                                                 
   15    48        INIT_FCALL                                               'var_dump'
         49        INIT_FCALL                                               'isinteger'
         50        SEND_VAL                                                 <false>
         51        DO_FCALL                                      0  $16     
         52        SEND_VAR                                                 $16
         53        DO_ICALL                                                 
         54      > RETURN                                                   1

Function isinteger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZnKvD
function name:  isInteger
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        CAST                                          4  ~1      !0
          2        CAST                                          6  ~2      ~1
          3        CAST                                          6  ~3      !0
          4        IS_IDENTICAL                                     ~4      ~2, ~3
          5      > RETURN                                                   ~4
    5     6*     > RETURN                                                   null

End of function isinteger

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.82 ms | 1403 KiB | 24 Q