3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); for ($i = 0; $i < 1000000; $i ++) { $random = (string)mt_rand(); $int = intval($random); } $end = microtime(true) - $start; echo $end.PHP_EOL; $start = microtime(true); for ($i = 0; $i < 1000000; $i ++) { $random = (string)mt_rand(); $int = (int)$random; } $end = microtime(true) - $start; echo $end.PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 28
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 28
Branch analysis from position: 37
Branch analysis from position: 28
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
Branch analysis from position: 6
filename:       /in/H5uQT
function name:  (null)
number of ops:  45
compiled vars:  !0 = $start, !1 = $i, !2 = $random, !3 = $int, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->13
    6     6    >   INIT_FCALL                                               'mt_rand'
          7        DO_ICALL                                         $8      
          8        CAST                                          6  ~9      $8
          9        ASSIGN                                                   !2, ~9
    7    10        CAST                                          4  ~11     !2
         11        ASSIGN                                                   !3, ~11
    4    12        PRE_INC                                                  !1
         13    >   IS_SMALLER                                               !1, 1000000
         14      > JMPNZ                                                    ~14, ->6
    9    15    >   INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $15     
         18        SUB                                              ~16     $15, !0
         19        ASSIGN                                                   !4, ~16
   10    20        CONCAT                                           ~18     !4, '%0A'
         21        ECHO                                                     ~18
   12    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $19     
         25        ASSIGN                                                   !0, $19
   13    26        ASSIGN                                                   !1, 0
         27      > JMP                                                      ->35
   15    28    >   INIT_FCALL                                               'mt_rand'
         29        DO_ICALL                                         $22     
         30        CAST                                          6  ~23     $22
         31        ASSIGN                                                   !2, ~23
   16    32        CAST                                          4  ~25     !2
         33        ASSIGN                                                   !3, ~25
   13    34        PRE_INC                                                  !1
         35    >   IS_SMALLER                                               !1, 1000000
         36      > JMPNZ                                                    ~28, ->28
   18    37    >   INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $29     
         40        SUB                                              ~30     $29, !0
         41        ASSIGN                                                   !4, ~30
   19    42        CONCAT                                           ~32     !4, '%0A'
         43        ECHO                                                     ~32
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.55 ms | 1400 KiB | 17 Q