3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myObj = (object)array('id' => 'foo', 'cat_1' => 'bar', 'cat_2' => 'baz'); print_r($myObj); $count = 0; foreach ($myObj as $key => $value) { if (strpos($key, 'cat_') === 0) { $count++; } } var_dump($count);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/rVAVV
function name:  (null)
number of ops:  22
compiled vars:  !0 = $myObj, !1 = $count, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          8  ~4      <array>
          1        ASSIGN                                                   !0, ~4
    6     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    7     5        ASSIGN                                                   !1, 0
    8     6      > FE_RESET_R                                       $8      !0, ->17
          7    > > FE_FETCH_R                                       ~9      $8, !2, ->17
          8    >   ASSIGN                                                   !3, ~9
    9     9        INIT_FCALL                                               'strpos'
         10        SEND_VAR                                                 !3
         11        SEND_VAL                                                 'cat_'
         12        DO_ICALL                                         $11     
         13        IS_IDENTICAL                                             $11, 0
         14      > JMPZ                                                     ~12, ->16
   10    15    >   PRE_INC                                                  !1
    8    16    > > JMP                                                      ->7
         17    >   FE_FREE                                                  $8
   14    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.52 ms | 940 KiB | 20 Q