3v4l.org

run code in 300+ PHP versions simultaneously
<?php $needle = 'www'; $sentence = 'This www.google.com is the http://www.facebook.com website that https://www.amazon.com make me awesome'; $pieces = explode(" ", $sentence); $urls = []; $urls = array_filter($pieces, function($v) use($needle) { return stripos($v, $needle) !== false; }); var_dump($urls);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZDLE
function name:  (null)
number of ops:  19
compiled vars:  !0 = $needle, !1 = $sentence, !2 = $pieces, !3 = $urls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'www'
    3     1        ASSIGN                                                   !1, 'This+www.google.com+is+the+http%3A%2F%2Fwww.facebook.com+website+that+https%3A%2F%2Fwww.amazon.com+make+me+awesome'
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    5     7        ASSIGN                                                   !3, <array>
    6     8        INIT_FCALL                                               'array_filter'
          9        SEND_VAR                                                 !2
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBZDLE%3A6%240'
         11        BIND_LEXICAL                                             ~9, !0
    8    12        SEND_VAL                                                 ~9
         13        DO_ICALL                                         $10     
    6    14        ASSIGN                                                   !3, $10
    9    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBZDLE%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZDLE
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v, !1 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    7     2        INIT_FCALL                                               'stripos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        TYPE_CHECK                                  1018  ~3      $2
          7      > RETURN                                                   ~3
    8     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBZDLE%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.91 ms | 1396 KiB | 21 Q