3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 'Hi Nemo'; function solution (string $str) { foreach(explode(' ', $str) as $wordNum => $value) { if ($value === 'Nemo') { return 'I found Nemo at ' . $wordNum+1; } } return 'I can\'t found Nemo'; } var_dump(solution($x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f4Quj
function name:  (null)
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hi+Nemo'
   18     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'solution'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function solution:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/f4Quj
function name:  solution
number of ops:  18
compiled vars:  !0 = $str, !1 = $value, !2 = $wordNum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5      > FE_RESET_R                                       $4      $3, ->15
          6    > > FE_FETCH_R                                       ~5      $4, !1, ->15
          7    >   ASSIGN                                                   !2, ~5
    9     8        IS_IDENTICAL                                             !1, 'Nemo'
          9      > JMPZ                                                     ~7, ->14
   10    10    >   ADD                                              ~8      !2, 1
         11        CONCAT                                           ~9      'I+found+Nemo+at+', ~8
         12        FE_FREE                                                  $4
         13      > RETURN                                                   ~9
    8    14    > > JMP                                                      ->6
         15    >   FE_FREE                                                  $4
   14    16      > RETURN                                                   'I+can%27t+found+Nemo'
   15    17*     > RETURN                                                   null

End of function solution

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.64 ms | 1463 KiB | 16 Q