3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bench($fn) { $start = microtime(true); for($i = 0; $i < 200000; $i++) $fn(); $end = microtime(true); echo("Time: " . ($end - $start) . "\n"); } bench(function() { 1 == 0; }); bench(function() { 1 === 0; }); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0791G
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'bench'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0791G%3A12%240'
          2        SEND_VAL                                                 ~0
          3        DO_FCALL                                      0          
   13     4        INIT_FCALL                                               'bench'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0791G%3A13%241'
          6        SEND_VAL                                                 ~2
          7        DO_FCALL                                      0          
   14     8      > RETURN                                                   1

Function bench:
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 = 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
Branch analysis from position: 7
filename:       /in/0791G
function name:  bench
number of ops:  21
compiled vars:  !0 = $fn, !1 = $start, !2 = $i, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    5     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->10
    6     7    >   INIT_DYNAMIC_CALL                                        !0
          8        DO_FCALL                                      0          
    5     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 200000
         11      > JMPNZ                                                    ~9, ->7
    8    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !3, $10
    9    16        SUB                                              ~12     !3, !1
         17        CONCAT                                           ~13     'Time%3A+', ~12
         18        CONCAT                                           ~14     ~13, '%0A'
         19        ECHO                                                     ~14
   10    20      > RETURN                                                   null

End of function bench

Function %00%7Bclosure%7D%2Fin%2F0791G%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0791G
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0791G%3A12%240

Function %00%7Bclosure%7D%2Fin%2F0791G%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0791G
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0791G%3A13%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.89 ms | 1403 KiB | 17 Q