3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 50; $start = microtime(true); $code = ' $ret = ""; for ($i=0; $i<100; $i++) { $ret.= md5($i.$ret); } return $ret; '; for($i = 0; $i < $count; $i++) { eval($code); } printf("#1, done in %f\n", microtime(true) - $start); $start = microtime(true); $f = function() { // return ++$y; $ret = ''; for ($i=0; $i<100; $i++) { $ret.= md5($i.$ret); } return $ret; }; for($i = 0; $i < $count; $i++) { $f(); } printf("#2, done in %f\n", microtime(true) - $start); ?>
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 = 8
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 28
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 28
Branch analysis from position: 33
Branch analysis from position: 28
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 8
Branch analysis from position: 12
Branch analysis from position: 8
filename:       /in/uV05h
function name:  (null)
number of ops:  42
compiled vars:  !0 = $count, !1 = $start, !2 = $code, !3 = $i, !4 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 50
    3     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    4     5        ASSIGN                                                   !2, '%0A++++++++%24ret+%3D+%22%22%3B%0A++++++++for+%28%24i%3D0%3B+%24i%3C100%3B+%24i%2B%2B%29+%7B%0A++++++++++++%24ret.%3D+md5%28%24i.%24ret%29%3B%0A++++++++%7D%0A++++++++return+%24ret%3B%0A'
   11     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->10
   14     8    >   INCLUDE_OR_EVAL                                          !2, EVAL
   11     9        PRE_INC                                                  !3
         10    >   IS_SMALLER                                               !3, !0
         11      > JMPNZ                                                    ~12, ->8
   17    12    >   INIT_FCALL                                               'printf'
         13        SEND_VAL                                                 '%231%2C+done+in+%25f%0A'
         14        INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $13     
         17        SUB                                              ~14     $13, !1
         18        SEND_VAL                                                 ~14
         19        DO_ICALL                                                 
   19    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !1, $16
   20    24        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuV05h%3A20%240'
         25        ASSIGN                                                   !4, ~18
   29    26        ASSIGN                                                   !3, 0
         27      > JMP                                                      ->31
   32    28    >   INIT_DYNAMIC_CALL                                        !4
         29        DO_FCALL                                      0          
   29    30        PRE_INC                                                  !3
         31    >   IS_SMALLER                                               !3, !0
         32      > JMPNZ                                                    ~23, ->28
   35    33    >   INIT_FCALL                                               'printf'
         34        SEND_VAL                                                 '%232%2C+done+in+%25f%0A'
         35        INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $24     
         38        SUB                                              ~25     $24, !1
         39        SEND_VAL                                                 ~25
         40        DO_ICALL                                                 
   36    41      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuV05h%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
Branch analysis from position: 3
filename:       /in/uV05h
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $ret, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, ''
   24     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->9
   25     3    >   INIT_FCALL                                               'md5'
          4        CONCAT                                           ~4      !1, !0
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
          7        ASSIGN_OP                                     8          !0, $5
   24     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 100
         10      > JMPNZ                                                    ~8, ->3
   27    11    > > RETURN                                                   !0
   28    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuV05h%3A20%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.89 ms | 1392 KiB | 19 Q