3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "hello this is a string and hello but this is a string hello but this is a string and "; if (preg_match_all('~(?=(\b(\w.{9,})(?=.*?\b\2)))~u', $string, $m)) { echo array_reduce($m[1], function ($a, $b) { return strlen($a ?? '') > strlen($b ?? '') ? $a : $b; }); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/hv5MN
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'hello+this+is+a+string+and+hello+but+this+is+a+string+hello+but+this+is+a+string+and+'
    4     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%7E%28%3F%3D%28%5Cb%28%5Cw.%7B9%2C%7D%29%28%3F%3D.%2A%3F%5Cb%5C2%29%29%29%7Eu'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $3      
          6      > JMPZ                                                         $3, ->14
    5     7    >   INIT_FCALL                                                   'array_reduce'
          8        FETCH_DIM_R                                          ~4      !1, 1
          9        SEND_VAL                                                     ~4
         10        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
         11        SEND_VAL                                                     ~5
         12        DO_ICALL                                             $6      
         13        ECHO                                                         $6
    6    14    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hv5MN
function name:  {closure:/in/hv5MN:5}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        COALESCE                                             ~2      !0
          3        QM_ASSIGN                                            ~2      ''
          4        STRLEN                                               ~3      ~2
          5        COALESCE                                             ~4      !1
          6        QM_ASSIGN                                            ~4      ''
          7        STRLEN                                               ~5      ~4
          8        IS_SMALLER                                                   ~5, ~3
          9      > JMPZ                                                         ~6, ->12
         10    >   QM_ASSIGN                                            ~7      !0
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~7      !1
         13    > > RETURN                                                       ~7
         14*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.08 ms | 1858 KiB | 15 Q