3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'November 1997'; $str2 = 'November 20, 2001'; $matches = []; preg_match('/\d{4}/', $str,$matches); var_dump( (int) $str, intval($str), filter_var($str, FILTER_SANITIZE_NUMBER_INT), $matches );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4OcRq
function name:  (null)
number of ops:  21
compiled vars:  !0 = $str, !1 = $str2, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'November+1997'
    3     1        ASSIGN                                                   !1, 'November+20%2C+2001'
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%5Cd%7B4%7D%2F'
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !2
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'var_dump'
    7     9        CAST                                          4  ~7      !0
         10        SEND_VAL                                                 ~7
    8    11        CAST                                          4  ~8      !0
         12        SEND_VAL                                                 ~8
    9    13        INIT_FCALL                                               'filter_var'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 519
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
   10    18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   11    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.9 ms | 1395 KiB | 19 Q