3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = '123/456/789'; // informatie uit strings.txt function hasEan($ean, $strings) { $strings = explode('/', $strings); return in_array($ean, $strings); } echo ' EAN 123 bestaat: '; if (hasEan('123', $strings)) { echo 'ja'; } else { echo 'nee'; } echo ' EAN 999 bestaat: '; if (hasEan('999', $strings)) { echo 'ja'; } else { echo 'nee'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Branch analysis from position: 18
filename:       /in/45TJ3
function name:  (null)
number of ops:  20
compiled vars:  !0 = $strings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '123%2F456%2F789'
   10     1        ECHO                                                     '+EAN+123+bestaat%3A+'
   11     2        INIT_FCALL                                               'hasean'
          3        SEND_VAL                                                 '123'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6      > JMPZ                                                     $2, ->9
   12     7    >   ECHO                                                     'ja'
   11     8      > JMP                                                      ->10
   14     9    >   ECHO                                                     'nee'
   16    10    >   ECHO                                                     '+EAN+999+bestaat%3A+'
   17    11        INIT_FCALL                                               'hasean'
         12        SEND_VAL                                                 '999'
         13        SEND_VAR                                                 !0
         14        DO_FCALL                                      0  $3      
         15      > JMPZ                                                     $3, ->18
   18    16    >   ECHO                                                     'ja'
   17    17      > JMP                                                      ->19
   20    18    >   ECHO                                                     'nee'
   21    19    > > RETURN                                                   1

Function hasean:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/45TJ3
function name:  hasEan
number of ops:  13
compiled vars:  !0 = $ean, !1 = $strings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2F'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !1, $2
    7     7        INIT_FCALL                                               'in_array'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $4      
         11      > RETURN                                                   $4
    8    12*     > RETURN                                                   null

End of function hasean

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.73 ms | 1453 KiB | 17 Q