3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (substr(PHP_VERSION, 0, 5) !== '7.1.6') die('Meh'); function test($label = '') { global $t; $t2 = microtime(1); if ($label) echo str_pad($label . ': ', 32, '.', STR_PAD_RIGHT) . ' ' . 1000 * ($t2 - $t) . 'ms' . "\n"; $t = $t2; } $c = 300; $c2 = 3000; test(); for ($i = $c; $i--;) { for ($j = $c2; $j--;) { $a = [0, 1, 2, 3, 4]; unset($a[0]); } } test('unset list => map'); for ($i = $c; $i--;) { for ($j = $c2; $j--;) { $a = ['c' => 0, 1, 2, 3, 4]; unset($a['c']); } } test('unset map => list'); for ($i = $c; $i--;) { for ($j = $c2; $j--;) { $a = ['c' => 0, 'd' => 1, 2, 3, 4]; unset($a['c']); } } test('unset map => map');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 14
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 27
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 40
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 42
Branch analysis from position: 46
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 42
Branch analysis from position: 46
Branch analysis from position: 42
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 29
Branch analysis from position: 33
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 29
Branch analysis from position: 33
Branch analysis from position: 29
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 16
Branch analysis from position: 20
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 16
Branch analysis from position: 20
Branch analysis from position: 16
filename:       /in/vMtLd
function name:  (null)
number of ops:  52
compiled vars:  !0 = $c, !1 = $c2, !2 = $i, !3 = $j, !4 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'substr'
          1        SEND_VAL                                                 '8.0.0'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 5
          4        DO_ICALL                                         $5      
          5        IS_NOT_IDENTICAL                                         $5, '7.1.6'
          6      > JMPZ                                                     ~6, ->8
          7    > > EXIT                                                     'Meh'
   11     8    >   ASSIGN                                                   !0, 300
   12     9        ASSIGN                                                   !1, 3000
   14    10        INIT_FCALL                                               'test'
         11        DO_FCALL                                      0          
   16    12        ASSIGN                                                   !2, !0
         13      > JMP                                                      ->20
   17    14    >   ASSIGN                                                   !3, !1
         15      > JMP                                                      ->18
   18    16    >   ASSIGN                                                   !4, <array>
   19    17        UNSET_DIM                                                !4, 0
   17    18    >   POST_DEC                                         ~13     !3
         19      > JMPNZ                                                    ~13, ->16
   16    20    >   POST_DEC                                         ~14     !2
         21      > JMPNZ                                                    ~14, ->14
   22    22    >   INIT_FCALL                                               'test'
         23        SEND_VAL                                                 'unset+list+%3D%3E+map'
         24        DO_FCALL                                      0          
   24    25        ASSIGN                                                   !2, !0
         26      > JMP                                                      ->33
   25    27    >   ASSIGN                                                   !3, !1
         28      > JMP                                                      ->31
   26    29    >   ASSIGN                                                   !4, <array>
   27    30        UNSET_DIM                                                !4, 'c'
   25    31    >   POST_DEC                                         ~19     !3
         32      > JMPNZ                                                    ~19, ->29
   24    33    >   POST_DEC                                         ~20     !2
         34      > JMPNZ                                                    ~20, ->27
   30    35    >   INIT_FCALL                                               'test'
         36        SEND_VAL                                                 'unset+map+%3D%3E+list'
         37        DO_FCALL                                      0          
   32    38        ASSIGN                                                   !2, !0
         39      > JMP                                                      ->46
   33    40    >   ASSIGN                                                   !3, !1
         41      > JMP                                                      ->44
   34    42    >   ASSIGN                                                   !4, <array>
   35    43        UNSET_DIM                                                !4, 'c'
   33    44    >   POST_DEC                                         ~25     !3
         45      > JMPNZ                                                    ~25, ->42
   32    46    >   POST_DEC                                         ~26     !2
         47      > JMPNZ                                                    ~26, ->40
   38    48    >   INIT_FCALL                                               'test'
         49        SEND_VAL                                                 'unset+map+%3D%3E+map'
         50        DO_FCALL                                      0          
         51      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/vMtLd
function name:  test
number of ops:  23
compiled vars:  !0 = $label, !1 = $t, !2 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      ''
    5     1        BIND_GLOBAL                                              !1, 't'
    6     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !2, $3
    7     6      > JMPZ                                                     !0, ->21
          7    >   INIT_FCALL                                               'str_pad'
          8        CONCAT                                           ~5      !0, '%3A+'
          9        SEND_VAL                                                 ~5
         10        SEND_VAL                                                 32
         11        SEND_VAL                                                 '.'
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $6      
         14        CONCAT                                           ~7      $6, '+'
         15        SUB                                              ~8      !2, !1
         16        MUL                                              ~9      ~8, 1000
         17        CONCAT                                           ~10     ~7, ~9
         18        CONCAT                                           ~11     ~10, 'ms'
         19        CONCAT                                           ~12     ~11, '%0A'
         20        ECHO                                                     ~12
    8    21    >   ASSIGN                                                   !1, !2
    9    22      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.2 ms | 1407 KiB | 23 Q