3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testWordCount ($in) { $is_match = preg_match('/^(\b[^\s]+\s*){2,10}$/', $in); return (boolean)$is_match; } echo ("Three words returns:\r\n".print_r(testWordCount('This is three'), true)."\r\n"); echo ("Fourty words returns:\r\n".print_r(testWordCount('1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40'), true)."\r\n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtCbo
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'testwordcount'
          2        SEND_VAL                                                 'This+is+three'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $1      
          7        CONCAT                                           ~2      'Three+words+returns%3A%0D%0A', $1
          8        CONCAT                                           ~3      ~2, '%0D%0A'
          9        ECHO                                                     ~3
    8    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'testwordcount'
         12        SEND_VAL                                                 '1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40'
         13        DO_FCALL                                      0  $4      
         14        SEND_VAR                                                 $4
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $5      
         17        CONCAT                                           ~6      'Fourty+words+returns%3A%0D%0A', $5
         18        CONCAT                                           ~7      ~6, '%0D%0A'
         19        ECHO                                                     ~7
         20      > RETURN                                                   1

Function testwordcount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtCbo
function name:  testWordCount
number of ops:  9
compiled vars:  !0 = $in, !1 = $is_match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%28%5Cb%5B%5E%5Cs%5D%2B%5Cs%2A%29%7B2%2C10%7D%24%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !1, $2
    4     6        BOOL                                             ~4      !1
          7      > RETURN                                                   ~4
    5     8*     > RETURN                                                   null

End of function testwordcount

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.11 ms | 1403 KiB | 19 Q