3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "intval \t integer casting". PHP_EOL; echo intval(42) ."\t". (int)42 . PHP_EOL; echo intval(4.2) ."\t". (int)(4.2) . PHP_EOL; echo intval('42') ."\t". (int)('42') . PHP_EOL; echo intval('+42') ."\t". (int)('+42') . PHP_EOL; echo intval('-42') ."\t". (int)('-42') . PHP_EOL; echo intval(042) ."\t". (int)(042) . PHP_EOL; echo intval('042') ."\t". (int)('042') . PHP_EOL; echo intval(1e10) ."\t". (int)(1e10) . PHP_EOL; echo intval('1e10') ."\t". (int)('1e10') . PHP_EOL; echo intval(0x1A) ."\t". (int)(0x1A) . PHP_EOL; echo intval(42000000) ."\t". (int)(42000000) . PHP_EOL; echo intval(420000000000000000000) ."\t". (int)(420000000000000000000) . PHP_EOL; echo intval('420000000000000000000') ."\t". (int)('420000000000000000000') . PHP_EOL; echo intval(array()) ."\t". (int)(array()) . PHP_EOL; echo intval(array('foo', 'bar')) ."\t". (int)(array('foo', 'bar')) . PHP_EOL; echo intval(false) ."\t". (int)(false) . PHP_EOL; echo intval(true) ."\t". (int)(true) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZ5bT
function name:  (null)
number of ops:  104
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'intval+%09+integer+casting%0A'
    5     1        CAST                                          4  ~0      42
          2        CONCAT                                           ~1      ~0, '%09'
          3        CAST                                          4  ~2      42
          4        CONCAT                                           ~3      ~1, ~2
          5        CONCAT                                           ~4      ~3, '%0A'
          6        ECHO                                                     ~4
    6     7        CAST                                          4  ~5      4.2
          8        CONCAT                                           ~6      ~5, '%09'
          9        CAST                                          4  ~7      4.2
         10        CONCAT                                           ~8      ~6, ~7
         11        CONCAT                                           ~9      ~8, '%0A'
         12        ECHO                                                     ~9
    7    13        CAST                                          4  ~10     '42'
         14        CONCAT                                           ~11     ~10, '%09'
         15        CAST                                          4  ~12     '42'
         16        CONCAT                                           ~13     ~11, ~12
         17        CONCAT                                           ~14     ~13, '%0A'
         18        ECHO                                                     ~14
    8    19        CAST                                          4  ~15     '%2B42'
         20        CONCAT                                           ~16     ~15, '%09'
         21        CAST                                          4  ~17     '%2B42'
         22        CONCAT                                           ~18     ~16, ~17
         23        CONCAT                                           ~19     ~18, '%0A'
         24        ECHO                                                     ~19
    9    25        CAST                                          4  ~20     '-42'
         26        CONCAT                                           ~21     ~20, '%09'
         27        CAST                                          4  ~22     '-42'
         28        CONCAT                                           ~23     ~21, ~22
         29        CONCAT                                           ~24     ~23, '%0A'
         30        ECHO                                                     ~24
   10    31        CAST                                          4  ~25     34
         32        CONCAT                                           ~26     ~25, '%09'
         33        CAST                                          4  ~27     34
         34        CONCAT                                           ~28     ~26, ~27
         35        CONCAT                                           ~29     ~28, '%0A'
         36        ECHO                                                     ~29
   11    37        CAST                                          4  ~30     '042'
         38        CONCAT                                           ~31     ~30, '%09'
         39        CAST                                          4  ~32     '042'
         40        CONCAT                                           ~33     ~31, ~32
         41        CONCAT                                           ~34     ~33, '%0A'
         42        ECHO                                                     ~34
   12    43        CAST                                          4  ~35     1.0e+10
         44        CONCAT                                           ~36     ~35, '%09'
         45        CAST                                          4  ~37     1.0e+10
         46        CONCAT                                           ~38     ~36, ~37
         47        CONCAT                                           ~39     ~38, '%0A'
         48        ECHO                                                     ~39
   13    49        CAST                                          4  ~40     '1e10'
         50        CONCAT                                           ~41     ~40, '%09'
         51        CAST                                          4  ~42     '1e10'
         52        CONCAT                                           ~43     ~41, ~42
         53        CONCAT                                           ~44     ~43, '%0A'
         54        ECHO                                                     ~44
   14    55        CAST                                          4  ~45     26
         56        CONCAT                                           ~46     ~45, '%09'
         57        CAST                                          4  ~47     26
         58        CONCAT                                           ~48     ~46, ~47
         59        CONCAT                                           ~49     ~48, '%0A'
         60        ECHO                                                     ~49
   15    61        CAST                                          4  ~50     42000000
         62        CONCAT                                           ~51     ~50, '%09'
         63        CAST                                          4  ~52     42000000
         64        CONCAT                                           ~53     ~51, ~52
         65        CONCAT                                           ~54     ~53, '%0A'
         66        ECHO                                                     ~54
   16    67        CAST                                          4  ~55     4.2e+20
         68        CONCAT                                           ~56     ~55, '%09'
         69        CAST                                          4  ~57     4.2e+20
         70        CONCAT                                           ~58     ~56, ~57
         71        CONCAT                                           ~59     ~58, '%0A'
         72        ECHO                                                     ~59
   17    73        CAST                                          4  ~60     '420000000000000000000'
         74        CONCAT                                           ~61     ~60, '%09'
         75        CAST                                          4  ~62     '420000000000000000000'
         76        CONCAT                                           ~63     ~61, ~62
         77        CONCAT                                           ~64     ~63, '%0A'
         78        ECHO                                                     ~64
   18    79        CAST                                          4  ~65     <array>
         80        CONCAT                                           ~66     ~65, '%09'
         81        CAST                                          4  ~67     <array>
         82        CONCAT                                           ~68     ~66, ~67
         83        CONCAT                                           ~69     ~68, '%0A'
         84        ECHO                                                     ~69
   19    85        CAST                                          4  ~70     <array>
         86        CONCAT                                           ~71     ~70, '%09'
         87        CAST                                          4  ~72     <array>
         88        CONCAT                                           ~73     ~71, ~72
         89        CONCAT                                           ~74     ~73, '%0A'
         90        ECHO                                                     ~74
   20    91        CAST                                          4  ~75     <false>
         92        CONCAT                                           ~76     ~75, '%09'
         93        CAST                                          4  ~77     <false>
         94        CONCAT                                           ~78     ~76, ~77
         95        CONCAT                                           ~79     ~78, '%0A'
         96        ECHO                                                     ~79
   21    97        CAST                                          4  ~80     <true>
         98        CONCAT                                           ~81     ~80, '%09'
         99        CAST                                          4  ~82     <true>
        100        CONCAT                                           ~83     ~81, ~82
        101        CONCAT                                           ~84     ~83, '%0A'
        102        ECHO                                                     ~84
   22   103      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.86 ms | 1451 KiB | 13 Q