3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ( ! class_exists('SplFixedArray')) { return; } $array = range(1, 6); foreach ($array as $key => $value) { if ($value & 1) { unset($array[ $key ]); } } echo count(SplFixedArray::fromArray($array)), PHP_EOL; // 6 echo count(SplFixedArray::fromArray($array, false)), PHP_EOL; // 3
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/QpqjB
function name:  (null)
number of ops:  33
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'SplFixedArray'
          2        DO_ICALL                                         $3      
          3        BOOL_NOT                                         ~4      $3
          4      > JMPZ                                                     ~4, ->6
    4     5    > > RETURN                                                   null
    7     6    >   INIT_FCALL                                               'range'
          7        SEND_VAL                                                 1
          8        SEND_VAL                                                 6
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
    9    11      > FE_RESET_R                                       $7      !0, ->18
         12    > > FE_FETCH_R                                       ~8      $7, !1, ->18
         13    >   ASSIGN                                                   !2, ~8
   10    14        BW_AND                                           ~10     !1, 1
         15      > JMPZ                                                     ~10, ->17
   11    16    >   UNSET_DIM                                                !0, !2
    9    17    > > JMP                                                      ->12
         18    >   FE_FREE                                                  $7
   15    19        INIT_STATIC_METHOD_CALL                                  'SplFixedArray', 'fromArray'
         20        SEND_VAR                                                 !0
         21        DO_FCALL                                      0  $11     
         22        COUNT                                            ~12     $11
         23        ECHO                                                     ~12
         24        ECHO                                                     '%0A'
   16    25        INIT_STATIC_METHOD_CALL                                  'SplFixedArray', 'fromArray'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 <false>
         28        DO_FCALL                                      0  $13     
         29        COUNT                                            ~14     $13
         30        ECHO                                                     ~14
         31        ECHO                                                     '%0A'
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.23 ms | 1396 KiB | 17 Q