3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); $arr = array("4","6","2","ololo"); $i=0; while($i < 50000) { $i++; json_encode(time); } $time1 = microtime(true) - $time; $time = microtime(true); $i=0; while($i < 50000) { $i++; serialize(time); } $time2 = microtime(true) - $time; echo '1 took ' . number_format($time1, 3) . "\n"; echo '2 took ' . number_format($time2, 3) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 25
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 25
Branch analysis from position: 32
Branch analysis from position: 25
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/Plmr9
function name:  (null)
number of ops:  52
compiled vars:  !0 = $time, !1 = $arr, !2 = $i, !3 = $time1, !4 = $time2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        ASSIGN                                                   !1, <array>
    5     5        ASSIGN                                                   !2, 0
    6     6      > JMP                                                      ->12
    8     7    >   PRE_INC                                                  !2
    9     8        INIT_FCALL                                               'json_encode'
          9        FETCH_CONSTANT                                   ~10     'time'
         10        SEND_VAL                                                 ~10
         11        DO_ICALL                                                 
    6    12    >   IS_SMALLER                                               !2, 50000
         13      > JMPNZ                                                    ~12, ->7
   11    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $13     
         17        SUB                                              ~14     $13, !0
         18        ASSIGN                                                   !3, ~14
   13    19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !0, $16
   14    23        ASSIGN                                                   !2, 0
   15    24      > JMP                                                      ->30
   17    25    >   PRE_INC                                                  !2
   18    26        INIT_FCALL                                               'serialize'
         27        FETCH_CONSTANT                                   ~20     'time'
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                                 
   15    30    >   IS_SMALLER                                               !2, 50000
         31      > JMPNZ                                                    ~22, ->25
   20    32    >   INIT_FCALL                                               'microtime'
         33        SEND_VAL                                                 <true>
         34        DO_ICALL                                         $23     
         35        SUB                                              ~24     $23, !0
         36        ASSIGN                                                   !4, ~24
   22    37        INIT_FCALL                                               'number_format'
         38        SEND_VAR                                                 !3
         39        SEND_VAL                                                 3
         40        DO_ICALL                                         $26     
         41        CONCAT                                           ~27     '1+took+', $26
         42        CONCAT                                           ~28     ~27, '%0A'
         43        ECHO                                                     ~28
   23    44        INIT_FCALL                                               'number_format'
         45        SEND_VAR                                                 !4
         46        SEND_VAL                                                 3
         47        DO_ICALL                                         $29     
         48        CONCAT                                           ~30     '2+took+', $29
         49        CONCAT                                           ~31     ~30, '%0A'
         50        ECHO                                                     ~31
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.44 ms | 1400 KiB | 21 Q