3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sessionArray = array( 'Romero' => 2, 'Ronaldinho' => 4, 'ronaldo' =>8, 'messi' => 20 ); $str="ro"; $id = array(); $name = array(); foreach($sessionArray as $key => $value) { if(strpos(strtolower($key), strtolower($str)) !== FALSE) { $id[] = $value; $name[] = $key; } } print_r($id); echo "\n"; print_r($name);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 24
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 23
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/c9Tdv
function name:  (null)
number of ops:  33
compiled vars:  !0 = $sessionArray, !1 = $str, !2 = $id, !3 = $name, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 'ro'
   12     2        ASSIGN                                                   !2, <array>
   13     3        ASSIGN                                                   !3, <array>
   15     4      > FE_RESET_R                                       $10     !0, ->24
          5    > > FE_FETCH_R                                       ~11     $10, !4, ->24
          6    >   ASSIGN                                                   !5, ~11
   17     7        INIT_FCALL                                               'strpos'
          8        INIT_FCALL                                               'strtolower'
          9        SEND_VAR                                                 !5
         10        DO_ICALL                                         $13     
         11        SEND_VAR                                                 $13
         12        INIT_FCALL                                               'strtolower'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $14     
         15        SEND_VAR                                                 $14
         16        DO_ICALL                                         $15     
         17        TYPE_CHECK                                  1018          $15
         18      > JMPZ                                                     ~16, ->23
   19    19    >   ASSIGN_DIM                                               !2
         20        OP_DATA                                                  !4
   20    21        ASSIGN_DIM                                               !3
         22        OP_DATA                                                  !5
   15    23    > > JMP                                                      ->5
         24    >   FE_FREE                                                  $10
   24    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                                 
   25    28        ECHO                                                     '%0A'
   26    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
218.12 ms | 1396 KiB | 19 Q