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/SEhKd
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 = 16
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/SEhKd
function name:  solution
number of ops:  19
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, ->16
          6    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          7    >   ASSIGN                                                   !2, ~5
    9     8        IS_IDENTICAL                                             !1, 'Nemo'
          9      > JMPZ                                                     ~7, ->15
   10    10    >   ROPE_INIT                                     3  ~9      'I+found+Nemo+at+'
         11        ROPE_ADD                                      1  ~9      ~9, !2
         12        ROPE_END                                      2  ~8      ~9, '%2B1'
         13        FE_FREE                                                  $4
         14      > RETURN                                                   ~8
    8    15    > > JMP                                                      ->6
         16    >   FE_FREE                                                  $4
   14    17      > RETURN                                                   'I+can%27t+found+Nemo'
   15    18*     > RETURN                                                   null

End of function solution

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.08 ms | 1463 KiB | 16 Q