3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vBase = [ 'date' => function($value) { return (bool)preg_match('/^\d{2}\.\d{2}\.\d{4}$/', $value); }, ]; $dateVal = date('d.m.Y'); var_dump( $vBase['date']($dateVal) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uipjd
function name:  (null)
number of ops:  15
compiled vars:  !0 = $vBase, !1 = $dateVal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUipjd%3A3%240'
    5     1        INIT_ARRAY                                       ~3      ~2, 'date'
    2     2        ASSIGN                                                   !0, ~3
    8     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'd.m.Y'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
   10     7        INIT_FCALL                                               'var_dump'
   11     8        FETCH_DIM_R                                      ~7      !0, 'date'
          9        INIT_DYNAMIC_CALL                                        ~7
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                                 
   12    14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FUipjd%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uipjd
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%5Cd%7B2%7D%5C.%5Cd%7B2%7D%5C.%5Cd%7B4%7D%24%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        BOOL                                             ~2      $1
          6      > RETURN                                                   ~2
    5     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUipjd%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.75 ms | 1400 KiB | 19 Q