3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = ['apple', 'orange', 'melon', 'banana', 'pineapple']; echo json_encode($fruits, JSON_PRETTY_PRINT) . "\n"; foreach ($fruits as $key=>$fruit) { if (in_array($fruit, ['apple', 'orange', 'melon', 'banana'])) { unset($fruits[$key]); } } echo json_encode($fruits, JSON_PRETTY_PRINT) . "\n"; $fruits = array_values($fruits); echo json_encode($fruits, JSON_PRETTY_PRINT) . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/2PneY
function name:  (null)
number of ops:  32
compiled vars:  !0 = $fruits, !1 = $fruit, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 128
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      $4, '%0A'
          6        ECHO                                                     ~5
    7     7      > FE_RESET_R                                       $6      !0, ->14
          8    > > FE_FETCH_R                                       ~7      $6, !1, ->14
          9    >   ASSIGN                                                   !2, ~7
    8    10        IN_ARRAY                                                 !1, <array>
         11      > JMPZ                                                     ~9, ->13
    9    12    >   UNSET_DIM                                                !0, !2
    7    13    > > JMP                                                      ->8
         14    >   FE_FREE                                                  $6
   13    15        INIT_FCALL                                               'json_encode'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 128
         18        DO_ICALL                                         $10     
         19        CONCAT                                           ~11     $10, '%0A'
         20        ECHO                                                     ~11
   15    21        INIT_FCALL                                               'array_values'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !0, $12
   17    25        INIT_FCALL                                               'json_encode'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 128
         28        DO_ICALL                                         $14     
         29        CONCAT                                           ~15     $14, '%0A'
         30        ECHO                                                     ~15
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.78 ms | 1002 KiB | 15 Q