3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 10000000; $t = -microtime(true); $j = 0; $k = 0; for ($i = 0; $i < $n; $i++) { $j++; $k += 1; } printf("%.2f\n", $t + microtime(true)); $t = -microtime(true); $a = []; $j = 0; $k = 0; for ($i = 0; $i < $n; $i++) { $j++; $k += ($a[$i] ?? 1); } printf("%.2f\n", $t + microtime(true));

Abusive script

This script was stopped while abusing our resources

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 = 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 33
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 33
Branch analysis from position: 41
Branch analysis from position: 33
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
Branch analysis from position: 10
filename:       /in/o93Mb
function name:  (null)
number of ops:  50
compiled vars:  !0 = $n, !1 = $t, !2 = $j, !3 = $k, !4 = $i, !5 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10000000
    5     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $7      
          4        MUL                                              ~8      $7, -1
          5        ASSIGN                                                   !1, ~8
    6     6        ASSIGN                                                   !2, 0
    7     7        ASSIGN                                                   !3, 0
    8     8        ASSIGN                                                   !4, 0
          9      > JMP                                                      ->13
    9    10    >   PRE_INC                                                  !2
   10    11        ASSIGN_OP                                     1          !3, 1
    8    12        PRE_INC                                                  !4
         13    >   IS_SMALLER                                               !4, !0
         14      > JMPNZ                                                    ~16, ->10
   12    15    >   INIT_FCALL                                               'printf'
         16        SEND_VAL                                                 '%25.2f%0A'
         17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $17     
         20        ADD                                              ~18     !1, $17
         21        SEND_VAL                                                 ~18
         22        DO_ICALL                                                 
   14    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $20     
         26        MUL                                              ~21     $20, -1
         27        ASSIGN                                                   !1, ~21
   15    28        ASSIGN                                                   !5, <array>
   16    29        ASSIGN                                                   !2, 0
   17    30        ASSIGN                                                   !3, 0
   18    31        ASSIGN                                                   !4, 0
         32      > JMP                                                      ->39
   19    33    >   PRE_INC                                                  !2
   20    34        FETCH_DIM_IS                                     ~28     !5, !4
         35        COALESCE                                         ~29     ~28
         36        QM_ASSIGN                                        ~29     1
         37        ASSIGN_OP                                     1          !3, ~29
   18    38        PRE_INC                                                  !4
         39    >   IS_SMALLER                                               !4, !0
         40      > JMPNZ                                                    ~32, ->33
   22    41    >   INIT_FCALL                                               'printf'
         42        SEND_VAL                                                 '%25.2f%0A'
         43        INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $33     
         46        ADD                                              ~34     !1, $33
         47        SEND_VAL                                                 ~34
         48        DO_ICALL                                                 
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.88 ms | 1011 KiB | 15 Q