3v4l.org

run code in 300+ PHP versions simultaneously
<?php function to_int32($value) { $intval = hexdec($value); // If 64 bit if (PHP_INT_SIZE === 8) { return ($intval | ~0x800000000); } // 32 bit return $intval; } echo to_int32('c0f672d4'); echo to_int32('83f6234');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3k9R2
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'to_int32'
          1        SEND_VAL                                                 'c0f672d4'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   15     4        INIT_FCALL                                               'to_int32'
          5        SEND_VAL                                                 '83f6234'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Function to_int32:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3k9R2
function name:  to_int32
number of ops:  10
compiled vars:  !0 = $value, !1 = $intval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'hexdec'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
    7     5      > JMPZ                                                     <true>, ->8
    8     6    >   BW_OR                                            ~4      !1, -34359738369
          7      > RETURN                                                   ~4
   12     8    > > RETURN                                                   !1
   13     9*     > RETURN                                                   null

End of function to_int32

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.96 ms | 1397 KiB | 17 Q