3v4l.org

run code in 300+ PHP versions simultaneously
<?php function int_cast_1($a) { return (int) $a; } function int_cast_2($a) { return $a + 0; } var_dump(int_cast_1('0xa')); var_dump(int_cast_2('0xa'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jJGAg
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'int_cast_1'
          2        SEND_VAL                                                 '0xa'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   11     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'int_cast_2'
          8        SEND_VAL                                                 '0xa'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function int_cast_1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jJGAg
function name:  int_cast_1
number of ops:  4
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      > RETURN                                                   ~1
    5     3*     > RETURN                                                   null

End of function int_cast_1

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

End of function int_cast_2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.15 ms | 1402 KiB | 17 Q