3v4l.org

run code in 300+ PHP versions simultaneously
<?php function absolute(&$n){ return ((($n >> 31) ^ $n) - ($n >> 31)); } $start = microtime(true); for($i = 0; $i <= 5000000; $i++){ absolute($y); } $end = microtime(true); echo $end - $start;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/4QTe4
function name:  (null)
number of ops:  19
compiled vars:  !0 = $start, !1 = $i, !2 = $y, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    7     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->10
    8     6    >   INIT_FCALL                                               'absolute'
          7        SEND_REF                                                 !2
          8        DO_FCALL                                      0          
    7     9        PRE_INC                                                  !1
         10    >   IS_SMALLER_OR_EQUAL                                      !1, 5000000
         11      > JMPNZ                                                    ~9, ->6
   10    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !3, $10
   11    16        SUB                                              ~12     !3, !0
         17        ECHO                                                     ~12
         18      > RETURN                                                   1

Function absolute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4QTe4
function name:  absolute
number of ops:  7
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        SR                                               ~1      !0, 31
          2        BW_XOR                                           ~2      !0, ~1
          3        SR                                               ~3      !0, 31
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
    4     6*     > RETURN                                                   null

End of function absolute

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
375.17 ms | 1399 KiB | 17 Q