3v4l.org

run code in 300+ PHP versions simultaneously
<?php $words = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dictum scelerisque sem a mollis. Nulla facilisi. Maecenas ut tempor nunc. Morbi leo nulla, rutrum in libero id, eleifend tempus velit. Maecenas elementum, erat lobortis dignissim accumsan, odio leo suscipit neque, eu ornare odio ligula a augue."; counter("Lorem", $words); function counter($find,$words) { echo "Total words: " . str_word_count($words) . "\n"; echo "Total letters: " . strlen($words) . "\n"; $vec = explode(" ", $words); if (in_array($find, $vec)) echo $find . " find in position " . (array_search($find, $vec) + 1); else echo $find . " not founded"; return; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HglUM
function name:  (null)
number of ops:  6
compiled vars:  !0 = $words
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Lorem+ipsum+dolor+sit+amet%2C+consectetur+adipiscing+elit.+Nullam+dictum+scelerisque+sem+a+mollis.+Nulla+facilisi.+Maecenas+ut+tempor+nunc.+Morbi+leo+nulla%2C+rutrum+in+libero+id%2C+eleifend+tempus+velit.+Maecenas+elementum%2C+erat+lobortis+dignissim+accumsan%2C+odio+leo+suscipit+neque%2C+eu+ornare+odio+ligula+a+augue.'
    3     1        INIT_FCALL_BY_NAME                                       'counter'
          2        SEND_VAL_EX                                              'Lorem'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   21     5      > RETURN                                                   1

Function counter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HglUM
function name:  counter
number of ops:  35
compiled vars:  !0 = $find, !1 = $words, !2 = $vec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'str_word_count'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $3      
          5        CONCAT                                           ~4      'Total+words%3A+', $3
          6        CONCAT                                           ~5      ~4, '%0A'
          7        ECHO                                                     ~5
    8     8        STRLEN                                           ~6      !1
          9        CONCAT                                           ~7      'Total+letters%3A+', ~6
         10        CONCAT                                           ~8      ~7, '%0A'
         11        ECHO                                                     ~8
    9    12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '+'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
   11    17        INIT_FCALL                                               'in_array'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $11     
         21      > JMPZ                                                     $11, ->31
   12    22    >   CONCAT                                           ~12     !0, '+find+in+position+'
         23        INIT_FCALL                                               'array_search'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $13     
         27        ADD                                              ~14     $13, 1
         28        CONCAT                                           ~15     ~12, ~14
         29        ECHO                                                     ~15
         30      > JMP                                                      ->33
   14    31    >   CONCAT                                           ~16     !0, '+not+founded'
         32        ECHO                                                     ~16
   19    33    > > RETURN                                                   null
   20    34*     > RETURN                                                   null

End of function counter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.78 ms | 1400 KiB | 21 Q