3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 'Hi Nemo'; function solution (string $str) { foreach(str_split($str) as $wordNum => $value) { if ($value === 'Nemo') { return "I found Nemo at $wordNum"; } } 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/tOsiT
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 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/tOsiT
function name:  solution
number of ops:  17
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                                               'str_split'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4      > FE_RESET_R                                       $4      $3, ->14
          5    > > FE_FETCH_R                                       ~5      $4, !1, ->14
          6    >   ASSIGN                                                   !2, ~5
    9     7        IS_IDENTICAL                                             !1, 'Nemo'
          8      > JMPZ                                                     ~7, ->13
   10     9    >   NOP                                                      
         10        FAST_CONCAT                                      ~8      'I+found+Nemo+at+', !2
         11        FE_FREE                                                  $4
         12      > RETURN                                                   ~8
    8    13    > > JMP                                                      ->5
         14    >   FE_FREE                                                  $4
   14    15      > RETURN                                                   'I+can%27t+found+Nemo'
   15    16*     > RETURN                                                   null

End of function solution

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.29 ms | 1463 KiB | 16 Q