3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mlbCities = array( 'Carolina', 'Atlanta', 'New Orleans', 'Philadelphia', 'St. Louis', 'Washington', 'Houston', 'Tennessee', 'New England', 'NY Jets', 'Cincinnati', 'Green Bay', 'Arizona', 'Jacksonville', 'Oakland', 'Kansas City', 'Minnesota', 'Detroit', 'Tampa Bay', 'Buffalo', 'Seattle', 'San Francisco', 'Pittsburgh', 'Chicago', 'Baltimore', 'San Diego', 'Cleveland', 'Denver', 'NY Giants', 'Dallas', 'Indianapolis', 'Miami' ); $string = 'San Francisco Giants'; foreach($mlbCities as $city) { $index = strrpos( $string, $city ); var_dump($index); var_dump(is_numeric($index)); if(is_numeric($index)) { print "yay"; } else { print "nay"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 26
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 26
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/OZ4Bo
function name:  (null)
number of ops:  28
compiled vars:  !0 = $mlbCities, !1 = $string, !2 = $city, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   37     1        ASSIGN                                                   !1, 'San+Francisco+Giants'
   39     2      > FE_RESET_R                                       $6      !0, ->26
          3    > > FE_FETCH_R                                               $6, !2, ->26
   40     4    >   INIT_FCALL                                               'strrpos'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
   41     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                                 
   42    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'is_numeric'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $10     
         16        SEND_VAR                                                 $10
         17        DO_ICALL                                                 
   43    18        INIT_FCALL                                               'is_numeric'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $12     
         21      > JMPZ                                                     $12, ->24
   44    22    >   ECHO                                                     'yay'
         23      > JMP                                                      ->25
   46    24    >   ECHO                                                     'nay'
   39    25    > > JMP                                                      ->3
         26    >   FE_FREE                                                  $6
   52    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.6 ms | 1396 KiB | 19 Q