3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "18:00 UTC+1"; print_r(array_values($b = explode(" ", $a))); $needle = 'UTC'; $matches = array_filter($b, function ($haystack) use($needle) { return(strpos($haystack, $needle)); }); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAH2E
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $b, !2 = $needle, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '18%3A00+UTC%2B1'
    4     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'array_values'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                           ~6      !1, $5
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                                 
    5    12        ASSIGN                                                   !2, 'UTC'
    7    13        INIT_FCALL                                               'array_filter'
         14        SEND_VAR                                                 !1
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcAH2E%3A7%240'
         16        BIND_LEXICAL                                             ~10, !2
    9    17        SEND_VAL                                                 ~10
         18        DO_ICALL                                         $11     
    7    19        ASSIGN                                                   !3, $11
   10    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FcAH2E%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.78 ms | 1396 KiB | 23 Q