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'); $dateVal[] = date('Y-m-d'); foreach ($dateVal as $date) { var_dump( [ 'value' => $date, 'isValidFormat' => $vBase['date']($date), ] ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/IshmM
function name:  (null)
number of ops:  27
compiled vars:  !0 = $vBase, !1 = $dateVal, !2 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FIshmM%3A3%240'
    5     1        INIT_ARRAY                                       ~4      ~3, 'date'
    2     2        ASSIGN                                                   !0, ~4
    8     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'd.m.Y'
          5        DO_ICALL                                         $7      
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  $7
    9     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'Y-m-d'
         10        DO_ICALL                                         $9      
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  $9
   11    13      > FE_RESET_R                                       $10     !1, ->25
         14    > > FE_FETCH_R                                               $10, !2, ->25
   12    15    >   INIT_FCALL                                               'var_dump'
   14    16        INIT_ARRAY                                       ~11     !2, 'value'
   15    17        FETCH_DIM_R                                      ~12     !0, 'date'
         18        INIT_DYNAMIC_CALL                                        ~12
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0  $13     
         21        ADD_ARRAY_ELEMENT                                ~11     $13, 'isValidFormat'
         22        SEND_VAL                                                 ~11
         23        DO_ICALL                                                 
   11    24      > JMP                                                      ->14
         25    >   FE_FREE                                                  $10
   18    26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FIshmM%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IshmM
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%2FIshmM%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.77 ms | 1400 KiB | 19 Q