3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = [ '0', '-0', '1', '-1', '0.0', '1.1', '-1.1', '0x111', '0111', '0b111', '-0x111', '-0111', '-0b111', '0.1e2', '-0.1e2', '0.1e-2', '-0.1e-2', ]; printf(' string | float | int' . PHP_EOL); foreach ($values as $value) { $float = filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_REQUIRE_SCALAR); $int = filter_var($value, FILTER_VALIDATE_INT, FILTER_REQUIRE_SCALAR); printf('%7s | %6s | %2s%s', $value, $float, $int, PHP_EOL); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 26
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 26
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/PKnsc
function name:  (null)
number of ops:  28
compiled vars:  !0 = $values, !1 = $value, !2 = $float, !3 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        INIT_FCALL                                               'printf'
          2        SEND_VAL                                                 '+string+%7C++float+%7C+int%0A'
          3        DO_ICALL                                                 
   24     4      > FE_RESET_R                                       $6      !0, ->26
          5    > > FE_FETCH_R                                               $6, !1, ->26
   25     6    >   INIT_FCALL                                               'filter_var'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 259
          9        SEND_VAL                                                 33554432
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   26    12        INIT_FCALL                                               'filter_var'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 257
         15        SEND_VAL                                                 33554432
         16        DO_ICALL                                         $9      
         17        ASSIGN                                                   !3, $9
   27    18        INIT_FCALL                                               'printf'
         19        SEND_VAL                                                 '%257s+%7C+%256s+%7C+%252s%25s'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !3
         23        SEND_VAL                                                 '%0A'
         24        DO_ICALL                                                 
   24    25      > JMP                                                      ->5
         26    >   FE_FREE                                                  $6
   28    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.13 ms | 1396 KiB | 17 Q