3v4l.org

run code in 300+ PHP versions simultaneously
<?php // The original function function a($i){$e=microtime(1)+$i;while(microtime(1)<$e);} // Use 'for' instead of 'while' function b($i){for($e=microtime(1)+$i;microtime(1)<$e;);} // Extract 'microtime' into a variable // Requires error_reporting(0) to suppress the "PHP Notice: Use of undefined constant microtime" // Use '-d error_reporting=0' in the command line function c($i){for($f=microtime,$e=$f(1)+$i;$f(1)<$e;);} // Squeeze the initialization of $f into its first use // PHP 7 only; it doesn't compile on older versions function d($i){for($e=($f=microtime)(1)+$i;$f(1)<$e;);}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fU11Y
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/fU11Y
function name:  a
number of ops:  13
compiled vars:  !0 = $i, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                         $2      
          4        ADD                                              ~3      $2, !0
          5        ASSIGN                                                   !1, ~3
          6      > JMP                                                      ->7
          7    >   INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $5      
         10        IS_SMALLER                                               $5, !1
         11      > JMPNZ                                                    ~6, ->7
         12    > > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/fU11Y
function name:  b
number of ops:  13
compiled vars:  !0 = $i, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                         $2      
          4        ADD                                              ~3      $2, !0
          5        ASSIGN                                                   !1, ~3
          6      > JMP                                                      ->7
          7    >   INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $5      
         10        IS_SMALLER                                               $5, !1
         11      > JMPNZ                                                    ~6, ->7
         12    > > RETURN                                                   null

End of function b

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/fU11Y
function name:  c
number of ops:  15
compiled vars:  !0 = $i, !1 = $f, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        FETCH_CONSTANT                                   ~3      'microtime'
          2        ASSIGN                                                   !1, ~3
          3        INIT_DYNAMIC_CALL                                        !1
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0  $5      
          6        ADD                                              ~6      $5, !0
          7        ASSIGN                                                   !2, ~6
          8      > JMP                                                      ->9
          9    >   INIT_DYNAMIC_CALL                                        !1
         10        SEND_VAL_EX                                              1
         11        DO_FCALL                                      0  $8      
         12        IS_SMALLER                                               $8, !2
         13      > JMPNZ                                                    ~9, ->9
         14    > > RETURN                                                   null

End of function c

Function d:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/fU11Y
function name:  d
number of ops:  15
compiled vars:  !0 = $i, !1 = $e, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        FETCH_CONSTANT                                   ~3      'microtime'
          2        ASSIGN                                           ~4      !2, ~3
          3        INIT_DYNAMIC_CALL                                        ~4
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0  $5      
          6        ADD                                              ~6      $5, !0
          7        ASSIGN                                                   !1, ~6
          8      > JMP                                                      ->9
          9    >   INIT_DYNAMIC_CALL                                        !2
         10        SEND_VAL_EX                                              1
         11        DO_FCALL                                      0  $8      
         12        IS_SMALLER                                               $8, !1
         13      > JMPNZ                                                    ~9, ->9
         14    > > RETURN                                                   null

End of function d

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.97 ms | 1400 KiB | 15 Q