3v4l.org

run code in 500+ PHP versions simultaneously
<?php var_dump(filter_var('-1.0', FILTER_VALIDATE_INT)); var_dump(filter_var(-1.0, FILTER_VALIDATE_INT)); function validatesAsInt($number) { $number = filter_var($number, FILTER_VALIDATE_INT); return ($number !== FALSE); } var_dump(validatesAsInt('-1.0')); var_dump(validatesAsInt(-1.0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bOX6X
function name:  (null)
number of ops:  27
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'filter_var'
          2        SEND_VAL                                                     '-1.0'
          3        SEND_VAL                                                     257
          4        DO_ICALL                                             $0      
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
    4     7        INIT_FCALL                                                   'var_dump'
          8        INIT_FCALL                                                   'filter_var'
          9        SEND_VAL                                                     -1
         10        SEND_VAL                                                     257
         11        DO_ICALL                                             $2      
         12        SEND_VAR                                                     $2
         13        DO_ICALL                                                     
   12    14        INIT_FCALL                                                   'var_dump'
         15        INIT_FCALL                                                   'validatesasint'
         16        SEND_VAL                                                     '-1.0'
         17        DO_FCALL                                          0  $4      
         18        SEND_VAR                                                     $4
         19        DO_ICALL                                                     
   13    20        INIT_FCALL                                                   'var_dump'
         21        INIT_FCALL                                                   'validatesasint'
         22        SEND_VAL                                                     -1
         23        DO_FCALL                                          0  $6      
         24        SEND_VAR                                                     $6
         25        DO_ICALL                                                     
         26      > RETURN                                                       1

Function validatesasint:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bOX6X
function name:  validatesAsInt
number of ops:  9
compiled vars:  !0 = $number
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    8     1        INIT_FCALL                                                   'filter_var'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     257
          4        DO_ICALL                                             $1      
          5        ASSIGN                                                       !0, $1
    9     6        TYPE_CHECK                                      1018  ~3      !0
          7      > RETURN                                                       ~3
   10     8*     > RETURN                                                       null

End of function validatesasint

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.53 ms | 2098 KiB | 17 Q