3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isInteger($a){ return (string)(int)$a === (string)$a; } var_dump(isInteger(1)); var_dump(isInteger('1')); var_dump(isInteger('a')); var_dump(isInteger('1a')); var_dump(isInteger('11111'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6Y1h
function name:  (null)
number of ops:  31
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                                                 1
          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                                                 '1'
          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                                                 'a'
         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                                                 '1a'
         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                                                 '11111'
         27        DO_FCALL                                      0  $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function isinteger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6Y1h
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:
157.97 ms | 1399 KiB | 20 Q