3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = time(); for ($i = 0; $i < 100000; $i++) { $s = str_repeat(' asd ', 1000); trim($s); } $diff = time() - $start; echo $diff / 1000;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/Bh7u6
function name:  (null)
number of ops:  23
compiled vars:  !0 = $start, !1 = $i, !2 = $s, !3 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $4      
          2        ASSIGN                                                   !0, $4
    6     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->14
    7     5    >   INIT_FCALL                                               'str_repeat'
          6        SEND_VAL                                                 '++asd+++'
          7        SEND_VAL                                                 1000
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
    8    10        INIT_FCALL                                               'trim'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
    6    13        PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 100000
         15      > JMPNZ                                                    ~11, ->5
   11    16    >   INIT_FCALL                                               'time'
         17        DO_ICALL                                         $12     
         18        SUB                                              ~13     $12, !0
         19        ASSIGN                                                   !3, ~13
   12    20        DIV                                              ~15     !3, 1000
         21        ECHO                                                     ~15
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.18 ms | 1395 KiB | 19 Q