3v4l.org

run code in 500+ PHP versions simultaneously
<?php $foo = [ '50/2021-10-31@2', '93/2021-11-14@2', '300/2022-02-14@2', ]; $bar = '2021-11-12'; $getTransitos = fn(string $test, array $values) => sscanf(array_values(array_filter( $values, fn($value) => strpos($value, $test) ))[0] ?? '', '%d/')[0] ?? null; var_dump($getTransitos($bar, $foo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fWGOY
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo, !1 = $bar, !2 = $getTransitos, !3 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, '2021-11-12'
   11     2        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          3        BIND_LEXICAL                                                 ~6, !3
          4        ASSIGN                                                       !2, ~6
   16     5        INIT_FCALL                                                   'var_dump'
          6        INIT_DYNAMIC_CALL                                            !2
          7        SEND_VAR_EX                                                  !1
          8        SEND_VAR_EX                                                  !0
          9        DO_FCALL                                          0  $8      
         10        SEND_VAR                                                     $8
         11        DO_ICALL                                                     
         12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fWGOY
function name:  {closure:/in/fWGOY:11}
number of ops:  24
compiled vars:  !0 = $test, !1 = $values, !2 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
          3        INIT_FCALL                                                   'sscanf'
          4        INIT_FCALL                                                   'array_values'
          5        INIT_FCALL                                                   'array_filter'
   12     6        SEND_VAR                                                     !1
   13     7        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          8        BIND_LEXICAL                                                 ~3, !0
   14     9        SEND_VAL                                                     ~3
   11    10        DO_ICALL                                             $4      
   14    11        SEND_VAR                                                     $4
   11    12        DO_ICALL                                             $5      
   14    13        FETCH_DIM_IS                                         ~6      $5, 0
         14        COALESCE                                             ~7      ~6
         15        QM_ASSIGN                                            ~7      ''
         16        SEND_VAL                                                     ~7
         17        SEND_VAL                                                     '%25d%2F'
   11    18        DO_ICALL                                             $8      
   14    19        FETCH_DIM_IS                                         ~9      $8, 0
         20        COALESCE                                             ~10     ~9
         21        QM_ASSIGN                                            ~10     null
         22      > RETURN                                                       ~10
         23*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fWGOY
function name:  {closure:{closure:/in/fWGOY:11}:13}
number of ops:  5
compiled vars:  !0 = $value, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        FRAMELESS_ICALL_2                strpos              ~2      !0, !1
          3      > RETURN                                                       ~2
   14     4*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.15 ms | 2027 KiB | 17 Q